perm filename NCUBE.JJW[UP,DOC] blob sn#828861 filedate 1986-11-23 generic text, type C, neo UTF8
COMMENT ⊗   VALID 00412 PAGES
C REC  PAGE   DESCRIPTION
C00001 00001
C00011 00002
C00012 00003
C00015 00004
C00018 00005
C00020 00006
C00024 00007
C00029 00008
C00034 00009
C00036 00010
C00038 00011
C00041 00012
C00046 00013
C00050 00014
C00053 00015
C00057 00016
C00062 00017
C00066 00018
C00069 00019
C00071 00020
C00075 00021
C00079 00022
C00082 00023
C00084 00024
C00087 00025
C00091 00026
C00094 00027
C00097 00028
C00100 00029
C00104 00030
C00107 00031
C00111 00032
C00114 00033
C00116 00034
C00121 00035
C00125 00036
C00130 00037
C00134 00038
C00138 00039
C00142 00040
C00147 00041
C00149 00042
C00154 00043
C00158 00044
C00162 00045
C00165 00046
C00169 00047
C00174 00048
C00175 00049
C00179 00050
C00183 00051
C00187 00052
C00190 00053
C00194 00054
C00200 00055
C00203 00056
C00207 00057
C00211 00058
C00213 00059
C00216 00060
C00220 00061
C00224 00062
C00228 00063
C00232 00064
C00236 00065
C00238 00066
C00240 00067
C00242 00068
C00244 00069
C00245 00070
C00249 00071
C00251 00072
C00253 00073
C00254 00074
C00256 00075
C00259 00076
C00260 00077
C00261 00078
C00264 00079
C00267 00080
C00268 00081
C00270 00082
C00272 00083
C00273 00084
C00274 00085
C00276 00086
C00278 00087
C00280 00088
C00282 00089
C00283 00090
C00285 00091
C00287 00092
C00289 00093
C00290 00094
C00291 00095
C00292 00096
C00295 00097
C00299 00098
C00301 00099
C00302 00100
C00304 00101
C00305 00102
C00307 00103
C00309 00104
C00311 00105
C00313 00106
C00315 00107
C00317 00108
C00320 00109
C00323 00110
C00324 00111
C00326 00112
C00327 00113
C00329 00114
C00331 00115
C00333 00116
C00334 00117
C00335 00118
C00339 00119
C00342 00120
C00345 00121
C00347 00122
C00349 00123
C00353 00124
C00355 00125
C00359 00126
C00361 00127
C00363 00128
C00365 00129
C00366 00130
C00369 00131
C00372 00132
C00376 00133
C00379 00134
C00381 00135
C00385 00136
C00386 00137
C00389 00138
C00391 00139
C00394 00140
C00396 00141
C00399 00142
C00401 00143
C00403 00144
C00405 00145
C00407 00146
C00411 00147
C00415 00148
C00417 00149
C00420 00150
C00423 00151
C00427 00152
C00429 00153
C00433 00154
C00437 00155
C00439 00156
C00443 00157
C00447 00158
C00450 00159
C00453 00160
C00458 00161
C00462 00162
C00466 00163
C00472 00164
C00476 00165
C00479 00166
C00481 00167
C00484 00168
C00487 00169
C00490 00170
C00493 00171
C00496 00172
C00498 00173
C00500 00174
C00503 00175
C00505 00176
C00509 00177
C00513 00178
C00514 00179
C00516 00180
C00519 00181
C00520 00182
C00524 00183
C00527 00184
C00531 00185
C00533 00186
C00537 00187
C00539 00188
C00541 00189
C00544 00190
C00546 00191
C00549 00192
C00553 00193
C00556 00194
C00559 00195
C00562 00196
C00565 00197
C00568 00198
C00571 00199
C00575 00200
C00579 00201
C00584 00202
C00588 00203
C00592 00204
C00597 00205
C00602 00206
C00605 00207
C00608 00208
C00612 00209
C00615 00210
C00619 00211
C00621 00212
C00623 00213
C00624 00214
C00626 00215
C00628 00216
C00630 00217
C00633 00218
C00635 00219
C00636 00220
C00638 00221
C00639 00222
C00640 00223
C00642 00224
C00644 00225
C00645 00226
C00646 00227
C00649 00228
C00651 00229
C00653 00230
C00656 00231
C00658 00232
C00659 00233
C00661 00234
C00662 00235
C00663 00236
C00665 00237
C00668 00238
C00669 00239
C00671 00240
C00673 00241
C00674 00242
C00675 00243
C00678 00244
C00681 00245
C00684 00246
C00687 00247
C00689 00248
C00692 00249
C00694 00250
C00696 00251
C00697 00252
C00698 00253
C00699 00254
C00702 00255
C00704 00256
C00706 00257
C00707 00258
C00708 00259
C00709 00260
C00710 00261
C00713 00262
C00716 00263
C00719 00264
C00720 00265
C00722 00266
C00723 00267
C00724 00268
C00725 00269
C00727 00270
C00728 00271
C00731 00272
C00732 00273
C00733 00274
C00734 00275
C00735 00276
C00736 00277
C00740 00278
C00744 00279
C00748 00280
C00750 00281
C00752 00282
C00754 00283
C00756 00284
C00758 00285
C00760 00286
C00762 00287
C00764 00288
C00766 00289
C00769 00290
C00772 00291
C00774 00292
C00776 00293
C00779 00294
C00781 00295
C00783 00296
C00786 00297
C00787 00298
C00791 00299
C00793 00300
C00797 00301
C00799 00302
C00801 00303
C00803 00304
C00805 00305
C00807 00306
C00808 00307
C00810 00308
C00812 00309
C00814 00310
C00816 00311
C00818 00312
C00820 00313
C00822 00314
C00823 00315
C00824 00316
C00827 00317
C00830 00318
C00833 00319
C00834 00320
C00835 00321
C00839 00322
C00841 00323
C00844 00324
C00845 00325
C00848 00326
C00851 00327
C00853 00328
C00855 00329
C00856 00330
C00858 00331
C00859 00332
C00862 00333
C00864 00334
C00866 00335
C00867 00336
C00869 00337
C00871 00338
C00873 00339
C00875 00340
C00876 00341
C00877 00342
C00880 00343
C00883 00344
C00885 00345
C00886 00346
C00889 00347
C00891 00348
C00895 00349
C00898 00350
C00901 00351
C00903 00352
C00907 00353
C00908 00354
C00911 00355
C00912 00356
C00915 00357
C00916 00358
C00919 00359
C00921 00360
C00924 00361
C00928 00362
C00933 00363
C00936 00364
C00939 00365
C00943 00366
C00945 00367
C00946 00368
C00948 00369
C00950 00370
C00951 00371
C00953 00372
C00958 00373
C00961 00374
C00962 00375
C00963 00376
C00966 00377
C00968 00378
C00969 00379
C00971 00380
C00973 00381
C00976 00382
C00980 00383
C00983 00384
C00985 00385
C00989 00386
C00990 00387
C00992 00388
C00994 00389
C00995 00390
C00999 00391
C01003 00392
C01006 00393
C01010 00394
C01011 00395
C01013 00396
C01015 00397
C01018 00398
C01021 00399
C01025 00400
C01028 00401
C01032 00402
C01034 00403
C01038 00404
C01041 00405
C01044 00406
C01048 00407
C01051 00408
C01053 00409
C01056 00410
C01059 00411
C01063 00412	
C01064 ENDMK
C⊗;
























			   NCUBE HANDBOOK


			    version 1.1





























					     Copyright NCUBE 1986





			   NCUBE HANDBOOK

			      Outline

     1	Abstract

     2	Introduction

     3	The System
	  3.1  System Overview and Specifications
	  3.2  Hypercube Array Description
	  3.3  Physical System Description
	       3.3.1  Processor Array
	       3.3.2  Input/Output System
		    3.3.2.1  Host Board
		    3.3.2.2  Graphics Board
		    3.3.2.3  Intersystem Board
	       3.3.3  System Enclosure

     4	The Processor
	  4.1  Introduction
	  4.2  Architecture Overview
	       4.2.1  Data Representation
	       4.2.2  Registers, Interrupts and Communication
	  4.3  Data Representation
	       4.3.1  Integers
	       4.3.2  Reals
	  4.4  Registers
	       4.4.1  General Registers
	       4.4.2  Input/Output Registers
	       4.4.3  Processor Registers
	  4.5  Interrupts and Exceptions
	       4.5.1  Interrupt Definitions
	       4.5.2  Error Flag
	  4.6  Communication
	  4.7  Instruction Formats and Addressing Modes
	       4.7.1  Opcode Formats
	       4.7.2  Addressing Modes
	  4.8  Instruction Definitions
	       4.8.1  Instruction Set Details
	       4.8.2  Instruction Definitions
	  4.9  Initialization
	  4.10	Appendix--"Programmer's Card Summary"
		4.10.1	Instruction Format
		4.10.2	Opcode Map
		4.10.3	Addressing Modes
		4.10.4	Processor Registers
		4.10.5	Interrupts
		4.10.6	Branch Conditions
		4.10.7	Instruction Performance





     5	The Software
	  5.1  Introduction
	  5.2  The Monitor
	       5.2.1  Introduction
	       5.2.2  Monitor Diagnostics
	       5.2.3  ROM Monitor Commands
	       5.2.4  RAM Monitor Commands
		    5.2.4.1  General RAM Monitor Commands
		    5.2.4.2  Debugging Monitor Commands
		    5.2.4.3  Disk Commands
		    5.2.4.4  Tape Control Commands
	  5.3  The Operating System (AXIS)
	       5.3.1  Overview
		    5.3.1.1  File System
			 5.3.1.1.1  File System Structure
			 5.3.1.1.2  Files
		    5.3.1.2  Editing
			 5.3.1.2.1  NMACS
		    5.3.1.3  Memory Management
		    5.3.1.4  Process Management
		    5.3.1.5  Device Management
			 5.3.1.5.1  Hypercube Array
			 5.3.1.5.2  Graphics System
			 5.3.1.5.3  SBX Interface
		    5.3.1.6  Protection
		    5.3.1.7  Statistics and Billing
		    5.3.1.8  Initialization
		    5.3.1.9  Shutdown
		    5.3.1.10 The Shell
	       5.3.2  Operating System Programmer's Manual
		    5.3.2.1  Commands
		    5.3.2.2  System Calls
		    5.3.2.3  Subroutines
		    5.3.2.4  Special Files
		    5.3.2.5  File Formats and Conventions
		    5.3.2.6  Games
	  5.4  Communication System (VORTEX and VERTEX)
	       5.4.1  Messages
	       5.4.2  VORTEX
	       5.4.3  VERTEX

     6	System Management
	  6.1  System Specifications
	  6.2  System Operation
	       6.2.1  Power Up
	       6.2.2  System Reset
	       6.2.3  Power Down
	       6.2.4  Start Up and Configuration
	       6.2.5  Tape Backup and Restore
	       6.2.6  User Accounts





     7	The User--A Tutorial
	  7.1  Introduction
	  7.2  Hypercube Mappings
	       7.2.1  Gray Code
	       7.2.2  One Dimensional Grid
	       7.2.3  Two Dimensional Grid
	       7.2.4  Three Dimensional Grid
	       7.2.5  Four Dimensional Grid
	       7.2.6  Perfect Shuffle
	       7.2.7  Trees
	  7.3  Computational Examples
	       7.3.1  Vector Product
	       7.3.2  Fast Fourier Transform
	       7.3.3  Simultaneous Linear Equations
	       7.3.4  Systems of Ordinary Differential Equations
	       7.3.5  Partial Differential Equations
	  7.4  Create a Program Using Editor and File System
	  7.5  Compile Using Fortran and Assembler
	  7.6  Link Modules
	  7.7  Load and Run Using Loader and Scheduler
	  7.8  Add Graphics Output Using Graphics System





     1	ABSTRACT

     The  NCUBE/ten  system  is  a supercomputer in   a   minicomputer
     form  factor.    It   uses   up  to  1024  identical  high  speed
     processors connected in an array to work  on  a  single  problem.
     The  system  is very  reliable  and only needs ordinary power and
     cooling.   The potential  performance  is  500  Million  Floating
     Point  Operations  per  Second  (MFLOPS)  or 2000 Million Integer
     Operations   per   Second   (MIPS).     The    system    supports
     multiprogramming  and  the  array  can  be logically divided into
     subsets for allocation among multiple users.


     2	INTRODUCTION

     The   NCUBE/ten  system  is  a  parallel   processor   consisting
     primarily of an array of up to 1024 processing nodes.   Each node
     is a general purpose processor  with  128K  bytes  of  local  ECC
     memory.   There  are  also  a  set  of  8  I/O  channels into the
     processing array.   Each of these  channels  can   be   connected
     to  a  number   of   I/O  options.   These options include a Host
     Board, a Graphics Board, an Intersystem Board for connecting  two
     NCUBE  systems and an Open System Board that allows custom device
     I/O.

     The  system uses parallel processing to accomplish several goals.
     The     primary    goals   are   to   improve   performance   and
     price-performance.   The  potential  system  performance  is  500
     MFLOPS  or  2000 MIPS at the price of a small mainframe computer.

     Parallel  processors in the past have suffered from high  failure
     rates.   Therefore,  we  have ranked improved reliability high in
     our set of goals.  The mean time to failure of a fully configured
     NCUBE system is about 5 (powered on) months.  This reliability is
     achieved by both reducing the chip count to a minimum through the
     use  of  proprietary full custom VLSI components and by providing
     error checking  (and correction on the  memory)  throughout   the
     system.   When  a  processing  node fails the system can continue
     operation on a  subset of the  array  with  reduced  performance,
     thus   providing  fault  tolerance  through graceful degradation,
     in	 addition  to reliability.

















				   - 1 -





     Modularity   is   also   an  important  characteristic   of   the
     NCUBE/ten  system.  The  array  is interconnected in an inductive
     topology called  a Hypercube (see 3.2) that can be  divided  into
     subarrays.   Thus   one  may begin with a minimal investment in a
     small (16 processors) system and later upgrade it gradually  with
     no  basic  architectural change.   The software can easily adjust
     to the number of processors in the system.   In fact one  of  the
     most  powerful  features  of  the  array  is  its support of high
     performance multiprocessing.   One job  can  run  on  the  entire
     array  or  several  jobs   can   run   at once on subsets of  the
     array.   This  "space sharing"   avoids   the  constant  swapping
     overhead  that  occurs  in conventional time sharing systems.  It
     also permits users to  run  their  applications  on  the  optimum
     number of processors to maximize efficiency.

     Modularity  also  enhances  system  extensibility.    Simply   by
     redesigning  the backplane and enclosure we can support a  larger
     array.   Also  by  connecting  NCUBE systems  together  with  the
     Intersystem Board, it is possible to use multiple  NCUBE  systems
     in  parallel or as a very powerful pipeline.   At  the  processor
     level  extensibility is provided by allowing for later compatible
     upgrades with more instructions and addressing modes through  the
     use of "escape" codes throughout the architecture.

     And finally simplicity is achieved:  at the system level with the
     small  air  cooled  enclosure  and the  small  number  of  easily
     maintainable   boards   and  at  the  processor  level   with   a
     consistently  symmetric  architecture.   The NCUBE  processor  is
     simple  to  program  at  the assembly  language  level  and  code
     generation is relatively easy for a high level language compiler.

     Through  highly  integrated parallel processing we have  achieved
     very  high levels of performance, price-performance, reliability,
     modularity,   extensibility   and   simplicity.    But   parallel
     processing is a two edged sword.  On one edge it is the answer to
     fundamental  limits  that conventional high performance  machines
     are  reaching,  but on the other it requires that the  programmer
     extract from his algorithms all the parallelism possible.  Enough
     research  has been done to show that for a large set of  problems
     parallel  processing is a viable solution.   Some of the  problem
     areas include simulation,  high speed graphics,  real time signal
     analysis   and   large  scale   inference   ("expert")   systems.
     Furthermore,  the  availability of the NCUBE system will  inspire
     more  research and we believe that eventually nearly all problems
     will  yield to parallel solutions.   We are strengthened in  this
     belief  by observing that most natural processes are  essentially
     local in space and parallel in time.











				   - 2 -





     3	THE SYSTEM

     3.1  System Overview and Specifications

     The   NCUBE/ten  system  consists  of  an  air  cooled  enclosure
     containing a backplane   with  up  to  24  boards,   a  disk/tape
     subsystem  and  power supplies.   The  backplane uses 16 slots to
     support  a  processor array  of  up  to  1024  processors,   each
     with  128K bytes of  local memory.   The  other  8 slots are used
     for various  I/O  options.  Each  I/O  slot  is  connected  to  a
     different   subset   of   128  processors   in  the  array.   The
     initially supported  I/O  options  which  will  be  described  in
     detail  later  include  a  color  Graphics Board,  an Intersystem
     Board for connecting two NCUBE systems, an Open System Board  and
     a  Host  Board  to  handle disk drives, a tape backup unit,  user
     terminals and a high speed printer.

     Each  node  in  the  processing  array  has  a  processor   whose
     peak performance  is approximately  1/2 MFLOPS on floating  point
     operations  and 2 MIPS on integer and logical  operations.   Thus
     a   fully  loaded  NCUBE/ten  system  with  1024 processors has a
     potential  performance   of  500  MFLOPS  or  2000  MIPS.    Each
     parallel  I/O "bus" into the array consists of two unidirectional
     data paths (one inbound, one outbound) that operate independently
     and  in   parallel.    Each  path  can  transfer data at up to 90
     Megabytes/sec.   A full system also requires about 25000  BTU  of
     cooling and uses 10 kilowatts of power (50 amps, 230 volts single
     phase AC circuit).

     An NCUBE system can be configured with a large number of options.
     The  minimum system has an enclosure for one SMD disk  drive (160
     MBytes and one  cartridge  tape  backup  unit  (65  MBytes),  and
     another  enclosure  for  one  Host Board  and one Processor Board
     populated with 16 nodes.  This minimum system supports  up  to  8
     users  and  has  potential performance of 30 MFLOPS, 120 MIPS and
     180 Megabytes/sec I/O capacity.   One  can  add  up  to  15  more
     Processor  Boards  and 7 more I/O boards can be included with any
     mix between Graphics Boards, Host Boards or  other  I/O  options.
     The  enclosure  will hold up to 4 ESMD disk drives and separately
     enclosed disk drives can be attached at the rate of  4  for  each
     Host Board.


     3.2  Hypercube Array Description

     The  processing  array consists of processors with  local  memory
     interconnected  in  a topology called a hypercube.   One  way  to
     describe   a   hypercube  (sometimes  called  an   "n-cube")   is
     graphically.  Hypercubes of low order can be illustrated as shown
     below (circles are nodes and lines are communication links):








				   - 3 -





	  ORDER	      HYPERCUBE GRAPH
	  -----	      ---------------
	  N = 0		    O

	  N = 1		O--------O

			O--------O
			|	 |
	  N = 2		|	 |
			|	 |
			O--------O


     Hypercubes can also be defined inductively.  Each processor has a
     label that is a binary number.
     Two  processors are connected if their labels differ in only  one
     place.  The low order hypercubes are listed below:

	  ORDER	      PROCESSOR LABELS
	  ------      ----------------
	  N = 0		   0

	  N = 1		   0
			   1

	  N = 2		  00
			  01
			  10
			  11

     From  an order (N - 1) hypercube it is very simple to  define  an
     order  N cube.   The (N - 1) hypercube will have nodes labeled as
     shown:
			  0xx...xx

			   (N - 1)

     First  another  (N	 - 1)  hypercube  is  constructed  with	 nodes
     labeled:
			  1xx...xx

			   (N - 1)

     And  then	all  (N	 - 1)  connections between  the	 two  (N  - 1)
     hypercubes are made so that every pair of node labels that differ
     only   in	their  most  significant  bit  are   connected	 (e.g.
     010...01 must be connected to 110...01).











				   - 4 -





     This  formulation	of the hypercube illustrates two of  its  most
     important properities:
	1  The number of interconnections per node grows as the Log2
	   of the number of processors which allows for more direct
	   interconnections than most array schemes have.
	2  An order N hypercube is made of 2 order (N - 1) hypercubes.
	   This allows for several beneficial features
	      a)  the system can be modular since a large array is
		  logically equivalent to a small one
	      b)  software can be written for a generic hypercube
		  independent of its order--the program will simply
		  run faster on a larger array
	      c)  a large system can be partitioned by the Operating
		  System among multiple users so that each has a
		  smaller hypercube to run his software.
     These  advantages	are not available in a typical	toroidal  grid
     (lattice)	type of interconnection scheme.	  But since   two  and
     three dimensional grids are very useful in many applications,  it
     is	 important to note that a hypercube can be mapped onto	either
     grid  simply  by  ignoring some of	 the  available	 communication
     links.





































				   - 5 -





     3.3  Physical System Description

     3.3.1  Processor Array

     The  processor array is constructed of 1 to 16 Processor  boards.
     Each  board  is 15" by 22" and contains 64 processors  each  with
     128K bytes of local memory and 11 I/O channels.   The  processors
     are  connected  in  an  order 6 hypercube  on  the  board.   This
     interconnection  uses 6 of the 11 channels with each  node.   The
     other  5 are brought to the edge of the board for  connecting  to
     the backplane.   Four of these channels are routed into the array
     and used to build larger hypercubes as listed below:

		1 board	 = order 6 hypercube (64 nodes)
		2 boards = order 7 hypercube (128 nodes)
		4 boards = order 8 hypercube (256 nodes)
		8 boards = order 9 hypercube (512 nodes)
	       16 boards = order 10 hypercube (1024 nodes).

     The  other  channel on each node is connected to one of  the  I/O
     slots  in  the  backplane.   Thus  each  I/O  board  is  able  to
     communicate  directly  with  up  to 128 processors  (an  order  7
     hypercube).

     3.3.2  I/O System

     The I/O system uses the 8 backplane slots (see below) that  allow
     an  I/O board to access up to an order 7 hypercube subset of  the
     array.   Each I/O board has 16 NCUBE nodes and each node has 8 of
     its I/O channels (0,1,...,7) dedicated to communicating with  the
     Processing Array.



























				   - 6 -





			 NCUBE SYSTEM BACKPLANE
			   (from board side)

	 | | | |     | | | | | | | | | | | | | | | |	 | | | |
	 | | | |     | | | | | | | | | | | | | | | |	 | | | |
	 | | | |     | | | | | | | | | | | | | | | |	 | | | |
	 4 5 6 7    15 14........9 8 7 6 5 4 3 2 1 0	 3 2 1 0

       I/O Boards	  Processor Boards	       I/O Boards


     Refering to the illustration above, let each Processor board slot
     be numbered (xxxx) in binary.  Also assume that the board in that
     slot  contains  the  hypercube (xxxx:yyyyyy) where  yyyyyy  is  a
     binary number that can range from 0 to 63.  (i.e. the ID's of the
     processors  on  board xxxx are xxxxyyyyyy where xxxx  is  fixed.)
     Then the following diagram illustrates the mapping between  nodes
     in the Main Array and nodes on an I/O board.

     ←←←←←←←←←←←←←←←←←←←←←←←←These bits designate the I/O slot number
     |		   |   |       (xyy = 0,1,...,7)
     |		   |   |
     x x x x y y y y y y
     | | | | | | |   |
     | | | | | | |   |
     | | | | ----------------These bits designate the node number on
     | | | |		     the I/O board
     | | | |
     | ----------------------These bits designate the channel number
     |			     on the node on the I/O board.  (If
     ------------------------x = 1 then the bits must be complemented)

     This  chart  illustrates  various mappings	 and  permits  several
     observations to be made:
	  1)  I/O slots 0,1,2,3 are connected to Array slots 0,1,...,7
     and I/O slots 4,5,6,7 are connected to Array slots 8,9,...,15.
	  2)  A node on an I/O board is connected to one processor  on
     each of the 8 array boards that are on its side of the backplane.
     Furthermore,  the	array node numbers that it is connected to are
     the same modulo the board number.	For example,  node 1 on an I/O
     board  in slot 3 is connected to processors numbered  0xxx000111;
     or processor 7 (node 7 on Array board 0, processor 71 hex (node 7
     on Array board 1, etc).
	  3)   A given channel number on all 16 nodes on an I/O	 board
     is connected to the same Array board.   For example, all channels
     numbered  2 on an I/O board are connected to processors on	 Array
     board  2  if the I/O board is in slot 0,1,2,3 or 13 if it	is  in
     slot 4,5,6,7.

     By  being  connected  to an order 7 hypercube an  I/O  board  has
     potential  bandwidth  of 180  Megabytes/sec.   The  optional  I/O
     boards    that  are  currently  supported  include  a Host Board,
     a Graphics Board  and  an   Intersystem  Board.   Each  board  is
     described in more detail below.




				   - 7 -





     3.3.2.1  Host Board

     At   least   one  Host Board must be  installed  in every  system
     and there can be up to 8 per system.   Its  primary  purpose   is
     to   run  the operating  system  including  the  cross compilers,
     assemblers   and  linker  and  to  control  a   wide   range   of
     peripherals.   It  has  an Intel 80286 with 4 Megabytes of memory
     for the  operating software.   There are also  four  sockets  for
     EPROM   that   contains   the  monitor  and   diagnostics.    The
     software  is described in section 5.

     In  addition  to the main 80286 processor running  the  operating
     system,   the  Host Board has eight RS-232 serial ports  and  one
     high speed printer port.   It has  the  logic  to control  up  to
     4  ESMD  disk  drives  and  three  iSBX   multimodule connectors.
     These multimodule connectors support  a  wide  range  of  options
     including   tape   drive  controllers,   network  interfaces  and
     interboard  buses   (for   I/O   boards).    The  Interboard  bus
     allows  users  attached  to  different  Host  Boards to access  a
     common  file  system that is spread across  several  disk  drives
     controlled  by  different controllers.   A block diagram  of  the
     Peripheral Controller board is shown below.


		  !!!!!!!!  BLOCK DIAGRAM   !!!!!!!!!


     The  sections  below describe the Peripheral Controller  in  more
     detail.


     3.3.2.1.1	Central Processor

     The  central processor of the Peripheral Controller is  an  Intel
     80286.  This  is  a high performance 16 bit processor that has  a
     compatibility mode with the 8086.   In addition it can address 16
     megabytes  of  memory and has memory  management  and  protection
     built  into  the  chip.   It  is  a very  effective  host  for  a
     multitasking/multiuser  operating system.   For more  details  on
     programming the 80286 see Intel's iAPX 286 Programmer's Reference
     Manual.

















				   - 8 -





     3.3.2.1.2	System Programmable Read-Only Memory (PROM)

     The  Peripheral  Controller has 8 sockets for PROM which  may  be
     loaded with devices from 2764's up to 27512's.   The PROM resides
     at location

			   F80000 to FFFFFF

     in	 the  80286 memory space.   Since these are byte wide  devices
     they are arranged in 2 banks with the following addresses.

		    CHIP    BANK 1 (top)     BANK 0
		    -----  -------------  -------------
		    2764   FFC000-FFFFFF  FF8000-FFBFFF
		    27128  FF8000-FFFFFF  FF0000-F7FFFF
		    27256  FF0000-FFFFFF  FE0000-FEFFFF
		    27512  FE0000-FFFFFF  FC0000-FDFFFF

     The  PROM's  are programmed by NCUBE and contain a	 monitor  that
     includes the following functions:

	  1) a bootstrap loader
	  2) a debugger
	  3) a diagnostic package
	  4) an offline system backup/restore facility

     For more details on the monitor see section 5.2.


     3.3.2.1.3	Global Random Access Memory (RAM)

     There  are 2 megabytes of global dual ported memory (RAM) on  the
     Peripheral	 Controller.   This memory can be directly accessed by
     both  the	80286  and  the SMD disk  controller  and  resides  at
     location
			     0 to 1FFFFF

     in the system memory space.




















				   - 9 -





     3.3.2.1.4	Local I/O Array

     There  is  a  local  array of 16 NCUBE processing  nodes  on  the
     Host  Board.    Each  node consists of an NCUBE processor and 128
     Kbytes of RAM.  This memory is triple  ported  since  it  can  be
     directly  accessed  by  its  NCUBE processor,  the 80286 and  the
     ESMD disk controller.   All 80286 and  disk  controller  accesses
     to  these  local memories are 16 bits only.   The main purpose of
     this array  is to provide communication (an I/O "bus") with   the
     main  Processing   Array.    Thus,   8 of the 11 channels on each
     node  are  dedicated  to  providing  communication  between   the
     Processing  Array  and    the  Host  Board.    For   details   on
     this interconnection  see  section  3.3.1.    The  nodes  on  the
     Peripheral  Controller  are  numbered  0,1,...,15 and their local
     memory resides in the 80286 address space according to the  table
     below.

		    Processor Number	       Address
		    ----------------	  ----------------
			   0		  200000 to 21FFFF
			   1		  220000 to 23FFFF
			   2		  240000 to 25FFFF
			   3		  260000 to 27FFFF
			   4		  280000 to 29FFFF
			   5		  2A0000 to 2BFFFF
			   6		  2C0000 to 2DFFFF
			   7		  2E0000 to 2FFFFF
			   8		  300000 to 31FFFF
			   9		  320000 to 33FFFF
			  10		  340000 to 35FFFF
			  11		  360000 to 37FFFF
			  12		  380000 to 39FFFF
			  13		  3A0000 to 3BFFFF
			  14		  3C0000 to 3DFFFF
			  15		  3E0000 to 3FFFFF


     Since  each of the  local processing nodes on the Host Board have
     3  communication  channels  uncommitted  to   I/O,    they    are
     interconnected  in  two  order  3  hypercubes.   That  is,  nodes
     numbered   0,1,...,7  form  one  hypercube  and  nodes   numbered
     8,9,...,15 form another hypercube.   It may appear that since the
     two  hypercubes  are  not  directly interconnected  it  would  be
     difficult  to move data from a node in one cube to a node in  the
     other.   However,  since  all the memory is in the  80286  memory
     space,  it is simple and fast to use the central processor or the
     DMA processor (see 3.3.3.2.1.7) to move the data.











				  - 10 -





     3.3.2.1.5	SBX Connectors

     There  are  three  iSBX (Intel TM) connectors on  the Host Board.
     These    connectors   provide  a  great   deal   of configuration
     flexibility since Intel and other companies make  a wide range of
     small  boards  for  the  SBX I/O bus.  There are boards for  high
     speed math,  graphics,   tape  drive  controllers,   floppy  disk
     controllers,   network  controllers,   etc.   If  an NCUBE system
     contains  more  that  one  Host  Board,  then  one  of  the   SBX
     connectors on each board is reserved for implementing a local bus
     so  that the operating system,  and particularly the file system,
     can  be  spread  over  the disk  drives  controlled  by  all  the
     Host Boards.  Thus, a user can access his files from  a  terminal
     on any installed Host Board.

     The devices that are inserted into the SBX connectors appear to a
     programmer  as locations in the 80286 I/O space that can be  read
     and  written.   They  can  also be controlled by the  82258  ADMA
     (Advanced  Direct Memory Access) chip.   The boards can  generate
     interrupts  to the 80286 (for details on interrupts  see  section
     3.3.2.1.10).  The data that is read or written can be either Byte
     or  Halfword and each SBX connector has 32 reserved I/O addresses
     (3 bits of address and 2 bits of chip select) as shown below.

	SBX Connector	     I/O Address	 Interrupt Vector
	-------------	     -----------	 ----------------
	     1		A0 to AF and B0 to BF	   # 82 at 148
	     2		80 to 8F and 90 to 9F	   # 81 at 144
	     3		60 to 6F and 70 to 7F	   # 80 at 140

     There are two types of SBX devices,   8 bit and 16 bit, but  both
     boards  have  the	equivalent of two 8  bit  registers  that  are
     activated	by the chip select bits (MCS0,	MCS1).	 The following
     table  contains the data transfer details.	  The Device and  Data
     columns refer to the number of bits in the device and in the data
     to be transferred respectively.

     SBX  Device  Data	 Registers	     Addresses
     ---  ------  ----	 ---------	     ---------
      1	    16	   16	 MCS1,MCS0	 A0,A2,A4,A6,A8,AA,AC,AE
	   8,16	    8	      MCS0	 A0,A2,A4,A6,A8,AA,AC,AE
	    16	    8	 MCS1		 A1,A3,A5,A7,A9,AB,AD,AF
	     8	    8	 MCS1		 B0,B2,B4,B6,B8,BA,BC,BE
      2	    16	   16	 MCS1,MCS0	 80,82,84,86,88,8A,8C,8E
	   8,16	    8	      MCS0	 80,82,84,86,88,8A,8C,8E
	    16	    8	 MCS1		 81,83,85,87,89,8B,8D,8F
	     8	    8	 MCS1		 90,92,94,96,98,9A,9C,9E
      3	    16	   16	 MCS1,MCS0	 60,62,64,66,68,6A,6C,6E
	   8,16	    8	      MCS0	 60,62,64,66,68,6A,6C,6E
	    16	    8	 MCS1		 61,63,65,67,69,6B,6D,6F
	     8	    8	 MCS1		 70,72,74,76,78,7A,7C,7E







				  - 11 -





     3.3.2.1.6	Printer (Centronics) Port

     There  is  one  high  speed printer I/O port  on  the Host Board.
     It  supports the Centronics protocol with 8 bits  of data  and  4
     bits of status.   It is intended for a   high   speed  peripheral
     such  as  a  printer  or plotter.   It is in the I/O space of the
     80286 at location 14 and also has DMA capability since  it can be
     controlled  by  the  82258  ADMA  device.    When  accessing this
     address  the  system  performs the  following  functions.   (When
     Reading,  bits 12 to 15 yield general system status,  not printer
     status.)

	  Write I/O Address 14:

	       bits 0-7:   printer data
	       bits 8-15:  centronics control signals

	  Read I/O Address 14:

	       bits 0-7:   printer data
	       bit 8:  1 = printer select
	       bit 9:  1 = printer paper error
	       bit 10: 1 = printer fault
	       bit 11: 1 = printer busy
	       bit 12: 1 = diagnostic mode, 0 = normal mode
	       bit 13: reserved
	       bit 14: reserved
	       bit 15: 1 = main power (-5) good


     3.3.2.1.7	Direct Memory Access (DMA) Controller

     The Host Board has  an  82258  ADMA  device  that   controls  the
     Direct   Memory  Access  in  the   system.   It  is  specifically
     intended  to  control  the 3 SBX connectors  and  the  Centronics
     parallel port.   However, it is a very powerful processor and can
     control other DMA functions in the system including moving blocks
     of   data  in  memory.    We  will  not  describe  its   complete
     functionality  but  instead  refer  the  user  to  Intel's  82258
     Manual for details.

     The  82258  has  4  DMA channels and each channel has  a  set  of
     registers  associated  with it.   Also there is a set  of  global
     registers.   All of these registers are in the 80286 I/O  address
     space as shown in the table below.













				  - 12 -





	 Global Register   Bits	  I/O Address
	 ---------------   ----	  -----------
	  Command (GCR)	    16	     100
	  Status (GSR)	    16	     102
	  Mode (GMR)	    16	     104
	  Burst (GBR)	     8	     106
	  Delay (GDR)	     8	     108

	Channel Register	     Bits	  I/O Addresses
					    DMA0   DMA1	  DMA2	 DMA3
	----------------	     ----   -------------------------
      Command Pointer (CPR)	      24     10A    12E	   152	  176
      Source Pointer (SPR)	      24     10E    132	   156	  17A
      Destination Pointer (DPR)	      24     112    136	   15A	  17E
      Translate Table Pointer (TTPR)  24     116    13A	   15E	  182
      List Pointer (LPR)	      24     11A    13E	   162	  186
      Byte Count (BCR)		      24     11E    142	   166	  18A
      Channel Command (CCR)	      24     122    146	   16A	  18E
      Mask (MASKR)		      16     126    14A	   16E	  192
      Compare (COMPR)		      16     128    14C	   170	  194
      Assembly (DAR)		      16     12A    14E	   172	  196
      Channel Status (CSR)	       8     12C    150	   174	  198

     The  Channel  Registers  can be written by	 setting  the  Command
     Pointer to point to a command block in memory and then giving the
     82258  a "start channel" command from the 80286.	The format  of
     the command block in memory is shown below































				  - 13 -





     15			       0
     ---------------------------  ----	<---- Command Pointer
     |	    Type 1 Command     |     |
     ---------------------------     |
     |	    Source Pointer     |     |
     --------------	       |     |
     |	    0	  |	       |     |
     ---------------------------     |
     |	 Destination Pointer   |     ----  Command Block
     --------------	       |     |
     |	    0	  |	       |     |
     ---------------------------     |
     |	     Byte Count	       |     |
     --------------	       |     |
     |	    0	  |	       |     |
     ---------------------------     |
     |	   Channel Status      |     |
     ---------------------------  ----
     |	 Command Extension     |     |
     ---------------------------     |
     |	      Mask	       |     |
     ---------------------------     |
     |	    Compare	       |     ----  Command Block Extension
     ---------------------------     |
     |	 Translate Pointer     |     |
     --------------	       |     |
     |	    0	  |	       |     |
     ---------------------------  ----






























				  - 14 -





     3.3.2.1.8	Serial Channels

     The Host Board has  8  serial  channels  that  are controlled  by
     four   8530   Serial  Communications  Controllers   (each  device
     handles  2  channels).    Each  8530  also  has  two  baud   rate
     generators  and interrupt generation logic.   There are a set  of
     control  (Write) registers and a set of status  (Read)  registers
     for each channel.   The registers are all 8 bits and all accesses
     described  below  are  byte  only.   A summary  of  the  register
     functions  is  listed  below (unless noted  two  copies  of  each
     register exist, one for each channel):

     READ REGISTER FUNCTIONS
	  RR0:	Transmit/Receive buffer status and External status
	  RR1:	Special Receive Condition status
	  RR2:	Interrupt Vector
		  Even channels = Unmodified; Odd channels = Modified
	  RR8:	Receive buffer (Data)
	  RR10: Miscellaneous status
	  RR12: Lower byte of baud rate generator time constant
	  RR13: Upper byte of baud rate generator time constant
	  RR15: External/Status interrupt information

     WRITE REGISTER FUNCTIONS
	  WR0:	Initialization commands for addressing, modes, CRC
	  WR1:	Transmit/Receive interrupt and data transfer mode
		  definition
	  WR2:	Interrupt Vector (accessed through either channel)
		  Only one WR2 per 8350
	  WR3:	Receive parameters and control
	  WR4:	Transmit/Receive miscellaneous parameters and modes
	  WR5:	Transmit parameters and controls
	  WR6:	Sync characters or SDLC address field
	  WR7:	Sync character or SDLC flag
	  WR8:	Transmit buffer (Data)
	  WR9:	Master interrupt control and reset (accessed through
		  either channel)  Only one WR9 per 8350
	  WR10: Miscellaneous transmitter/receiver control bits
	  WR11: Clock mode control
	  WR12: Lower byte of baud rate generator time constant
	  WR13: Upper byte of baud rate generator time constant
	  WR14: Miscellaneous control bits
	  WR15: External/Status interrupt control















				  - 15 -





     The  only  registers  that can be directly addressed in  the  I/O
     space  of the 80286 are the two Data registers (RR8 and WR8)  and
     RR0  and  WR0.   In  order to read or write  any  other  register
     requires two steps:
	  1) write the appropriate code into WR0 then
	  2) perform the read or write operation.
     After  doing  this  bits  0 through 4 of  WR0  are  automatically
     cleared  so  that  WR0  points to WR0  or  RR0  again.   The  I/O
     addresses   corresponding  to  the  8530  devices  and Host Board
     channels are listed  in  the  table  below.    Each  channel  can
     generate   four  interrupts  to  indicate   the  conditions:   Tx
     empty,  Status  Change,  Rx Ready and Special Rx.   The interrupt
     vector  addresses (assuming the given vector bases are used)  are
     also  listed below.   (To obtain the interrupt numbers divide the
     vector address by four.)

	       Device:	  SSC 0	      SSC 1	  SSC 2	      SSC 3
	     Channels:	 0     1     2	   3	 4     5     6	   7
	I/O Addresses:
     Status: RR0 & WR0	 D4    D0    DC	   D8	 E4    E0    EC	   E8
     Data:   RR8 & WR8	 D6    D2    DE	   DA	 E6    E2    EE	   EA
       Vector Address:
	  Vector Base:	    28		30	    38		40
	     Tx Empty:	 A0    B0    C0	   D0	 E0    F0   100	  110
	Status Change:	 A4    B4    C4	   D4	 E4    F4   104	  114
	     Rx Ready:	 A8    B8    C8	   D8	 E8    F8   108	  118
	   Special Rx:	 AC    BC    CC	   DC	 EC    FC   10C	  11C


     Each  Serial  Channel  Controller has  an	integrated  baud  rate
     generator	that depends on the setting of a Time  Constant.   The
     equation and a baud rate table are given below.

	  Clock Rate:  1.8432 Mhz
	    Equation:  Time Constant = (57600 / baud rate) - 2
	       Table:  Baud Rate    Time Constant
			 19200		 1
			  9600		 4
			  4800		10
			  3600		14
			  2400		22
			  2000		27
			  1800		30
			  1200		46
			   600		94
			   300	       190
			   150	       382
			   134.5       426
			   110	       522
			    75	       766
			    50	      1150







				  - 16 -





     3.3.2.1.9	SMD Disk Controller

     The  Host  Board has an ESMD disk controller unit.  It is capable
     of controlling up to four standard  SMD  disks  drives.  Data  is
     accessed in blocks of 1024 bytes at a rate of about 1.5 Megabytes
     per second.  The disk controller unit consists of 6 registers  in
     the I/O address space which are described below.

	  1) Command/Status Register:
	       I/O Address:  00
	       Write:  Command
		    bit 0 --|  |--000 = Seek & Read Sector
			    |  |  001 = Reset Disk Fault & Recalibrate
			    |--|  010 = Seek & Write Sector
			    |  |  011 = Seek & Format Sector
		    bit 2 --|  |  100 = Read Sector & No Checking
		    bit 3   |  |  101 = Seek to Specified Sector
		     .	    |  |  110 = Reserved
		     .	    |  |--111 = Seek & Format Sector from
		     .	    |-|		Memory
		    bit 15 -| |
			      |---------Do Not Care

	       Read:  Status
		    bit 0:  Command bit 0
		    bit 1:  Command bit 1
		    bit 2:  Command bit 2
		    bit 3:  1 = Header Sync Error
		    bit 4:  1 = Header Address Error
		    bit 5:  1 = Header CRC Error
		    bit 6:  1 = Data Sync Error
		    bit 7:  1 = Data CRC Error
		    bit 8:  1 = Data Overrun/Underrun Error
		    bit 9:  1 = Illegal Memory Access
		    bit 10: 1 = Controller Ready
		    bit 11: 1 = Disk Ready
		    bit 12: 1 = Disk Selected
		    bit 13: 1 = Seek Error
		    bit 14: 1 = Write Error
		    bit 15: 1 = Disk Fault

	  2) Control
	       I/O Address:  02
	       Read and Write
		    bit 0:--|-- Unit Select
		    bit 1:--|
		    bit 2:  Reserved (must be 0)
		    bit 3:  Reserved (must be 0)
		    bit 4:  1 = Servo Offset +
		    bit 5:  1 = Servo Offset -
		    bit 6:  1 = Data Strobe Early
		    bit 7:  1 = Data Strobe Late






				  - 17 -





	  3) Low Memory Address
	       I/O Address:  04
	       Read and Write (Read may not be valid if controller is
			       busy)
		    bit 0 --|
		     :	    |
		     :	    |-- Low order part of memory address
		    bit 15 -|

	  4) High Memory Address
	       I/O Address:  06
	       Write
		    bit 0 --|
		     :	    |
		     :	    |-- High order part of memory address
		    bit 7 --|
		    bit 8 --|
		     :	    |
		     :	    |-- Do Not Care
		    bit 15 -|
	       Read
		    bit 0 --|
		     :	    |
		     :	    |-- High order part of memory address
		    bit 7 --|
		    bit 8:  0 = Disk 0 Connected
		    bit 9:  0 = Disk 1 Connected
		    bit 10: 0 = Disk 2 Connected
		    bit 11: 0 = Disk 3 Connected
		    bit 12: Reserved
		    bit 13: Reserved
		    bit 14: Reserved
		    bit 15: Reserved

	  5) Head/Sector
	       I/O Address:  08
	       Read and Write
		    bit 0 --|
		     :	    |
		     :	    |-- Sector Selector
		    bit 5 --|
		    bit 6:  Reserved
		    bit 7:  Reserved
		    bit 8 --|
		     :	    |
		     :	    |-- Head Selector
		    bit 11 -|
		    bit 12: Reserved
		    bit 13: Reserved
		    bit 14: Reserved
		    bit 15: Reserved







				  - 18 -





	  6) Cylinder
	       I/O Address:  0A
	       Read and Write
		    bit 0 --|
		     :	    |
		     :	    |-- Cylinder Selector
		    bit 11 -|
		    bit 12: Reserved
		    bit 13: Reserved
		    bit 14: Reserved
		    bit 15: Reserved

     In addition to the registers listed above there are two more  I/O
     addresses  and an interrupt associated with the disk  controller.
     Writing  to  the I/O addresses causes the disk controller  to  be
     enabled  or  disabled.   Reading  from these addresses  yields  a
     system ID (see 3.3.2.1.10).   The interrupt indicates that a disk
     access  has  completed.   The addresses and interrupt number  are
     given below.

	  1) Write 18:	Disable disk controller
	  2) Write 1A:	Enable disk controller
	  3) Interrupt 83 (vector address 14C):	 Disk access complete


     3.3.2.1.10	 System Control

     There are a set of I/O addresses associated with various  aspects
     of system control.   The controls include power supply monitoring
     and  sequencing,  error sensing and signaling,  and board resets.
     All of the addresses and controls are described below.

	  1) Array Reset
	       I/O Address:  10
	       Read and Write (Write causes reset)
		 For k = 0,1,...,15
		    bit k:  Resets Board k in Connector Jn, n = 20 - k





















				  - 19 -





	  2) Control
	       I/O Address:  12
	       Read and Write
		    bit 0:  0 = Enable system memory error correction
		    bit 1:  0 = System memory check bit write enable
		    bit 2:  1 = Front panel light indicator # 1
		    bit 3:  1 = Front panel light indicator # 2
		    bit 4:  0 = Reset reserved memory error (attempt
				to access locations between PROM and
				RAM)--bit must be 1 and NMI enabled
				to latch error
		    bit 5:  0 = Reset front panel interrupt--bit must
				be 1 and NMI enabled to latch error
		    bit 6:  1 = Enable Nonmaskable Interrupt (NMI)
		    bit 7:  1 = Turn off +5 power supplies
		    bit 8:  1 = Turn on +24 power supply
		    bit 9:  1 = Turn on +12 disk power supply
		    bit 10: 1 = Turn on +5 disk power supply
		    bit 11: 1 = Turn on +12 power supply
		    bit 12: 1 = Turn on -5 and -12 power supplies
		    bit 13: 1 = Turn on -12 disk power supply
		    bit 14: 0 = Reset local hypercubes
		    bit 15: 0 = Fans on (1 = Fans off): CAUTION:  It
				is very dangerous to turn the fans
				off.  This is for testing ONLY.

	  3) Reset/Status
	       I/O Address:  16
	       Write--Reset
		    Reset local array ECC error (data = do not care)
	       Read--Status
		    bit 0:  1 = #1  +5 power good
		    bit 1:  1 = #2  +5 power good
		    bit 2:  1 = #3  +5 power good
		    bit 3:  1 = #4  +5 power good
		    bit 4:  1 = Main +12 power good
		    bit 5:  1 = Main -12 power good
		    bit 6:  1 = Disk +24 power good
		    bit 7:  1 = Disk +12 power good
		    bit 8:  1 = Disk +5 power good
		    bit 9:  1 = Disk -12 power good
		  bits 10-15 refer to Nonmaskable Interrupt (NMI)
		    bit 10: 0 = Illegal memory access interrupt
		    bit 11: 0 = System memory ECC interrupt
		    bit 12: 0 = Local array memory ECC interrupt
		    bit 13: 0 = Front panel interrupt
		    bit 14: 0 = Watch dog timer interrupt
		    bit 15: 0 = Power fail interrupt










				  - 20 -





	  4) Disk Disable/System ID
	       I/O Address:  18
	       Write--Disable
		    Disable disk controller (data = do not care)
	       Read--System ID
		    bits 0 to 2:   I/O slot number
		    bits 3 to 15:  Low order part of system ID

	  5) Disk Enable/System ID
	       I/O Address:  1A
	       Write--Enable
		    Enable disk controller (data = do not care)
	       Read--System ID
		    bits 0 to 7:  High order part of system ID

	  6) Reset/ECC
	       I/O Address:  1C
	       Write--Reset
		    Reset system memory ECC error (data = do not care)
	       Read--ECC
		    ECC syndrome--the table below indicates the
		    interpretation of the syndrome.

		      Syndrome Decoding

		   1) bits 7,6 = Memory Bank
		   2) bits 5,4,3,2,1,0 = Table

	  bits	0 | 0	 1    0	   1	0    1	  0    1
		1 | 0	 0    1	   1	0    0	  1    1
	  5 4 3 2 | 0	 0    0	   0	1    1	  1    1
	  --------|--------------------------------------
	  0 0 0	  | N	CB0  CB1   D   CB2   D	  D    -
	  0 0 1	  |CB3	 D    D	   0	D    1	  2    D
	  0 1 0	  |CB4	 D    D	   5	D    6	  7    D
	  0 1 1	  | D	 3    -	   D	4    D	  D    -
	  1 0 0	  |CB5	 D    D	  11	D    -	 12    D
	  1 0 1	  | D	 8    9	   D   10    D	  D    -
	  1 1 0	  | D	13   14	   D   15    D	  D    -
	  1 1 1	  | -	 D    D	   -	D    -	  -    D

		    N = No error
		  CBX = Error in Check Bit X
		    X = Error in bit X
		    D = Double bit error













				  - 21 -





     3.3.2.1.11	 Temperature Sensors

     The  NCUBE  system contains sixteen temperature  sensing  devices
     located  throughout  the  enclosure.   They are used  to  prevent
     system  damage  caused by over heating.   In order to  trigger  a
     sensor  and  take  a  measurement,   software  must  perform  the
     following steps.

	  1) Write to one of I/O addresses 38,3A,3C or 3E
	       bits 0 to 3:  Select one of 16 sensors
	       bits 4 to 15: Do not care

	  2) Write to the same address with the same data at least 2
	     microseconds later (the sensor multiplexor requires a
	     settling time).  After the temperature has been sensed,
	     an interrupt is generated:
	       Interrupt # 86 (vector at memory address 158)

	  3) Read from same address
	       bits 0 to 7:  Measured temperature (give formula or
			     table)
	       bits 8 to 15: Reserved


     3.3.2.1.12	 Real Time Clock


     The Host Board has  a  real  time  clock   that    is  controlled
     and   sensed by writing and reading the following  I/O addresses.

	  1) Control/Status
	       I/O Address:  40
	       Write--Control
		    bit 0:  0 = Interrupt run;	1 = Interrupt stop
		    bit 1:  0 = Select clock set register --|
			    1 = Select interrupt register --|-see (2)
		    bit 2:  0 = Clock run;  1 = Clock stop
		    bit 3:  0 = Normal mode;  1 = Test mode
		    bits 4 to 15:  Do not care
	       Read--Status
		    bit 0:  Interrupt flag (same as Write)
		    bit 1:  0
		    bit 2:  0
		    bit 3:  Data changed flag
		    bits 4 to 15:  Reserved













				  - 22 -





	  2) Set/Interrupt
	       I/O Address:  5E
	       Read and Write
		 If Control/Status (40) bit 0 = 0
		    bit 0:  0 = 12 hour mode;  1 = 24 hour mode
		    bit 1:  0 = AM;  1 = PM   (0 in 24 hour mode)
		    bit 2 --|
		    bit 3 --|-- Leap year counter (00 = Leap year)
		 If Control/Status (40) bit 0 = 1
		    bit 0 --|
		    bit 1   |-- Interrupt period (see table below)
		    bit 2 --|
		    bit 3:  0 = Single interrupt
			    1 = Repeated interrupt

		    Interrupt Period   bits 2,1,0
		    ----------------   ----------
		      No Interrupt	  000
		       0.1 Seconds	  001
		       0.5 Seconds	  010
		       1.0 Seconds	  011
		       5.0 Seconds	  100
		      10.0 Seconds	  101
		      30.0 Seconds	  110
		      60.0 Seconds	  111

	  3) Time Set/Read
	       Write (Set) and Read (Sense)
	       I/O Address   Function
		    42	      Tenths of seconds (Read only)
		    44	      Seconds
		    46	      Tens of seconds
		    48	      Minutes
		    4A	      Tens of minutes
		    4C	      Hours
		    4E	      Tens of hours
		    50	      Days
		    52	      Tens of days
		    54	      Months
		    56	      Tens of months
		    58	      Years
		    5A	      Tens of years
		    5C	      Day of week (Modulo 7 counter)

     The interrupt associated with the Real Time Clock is:

	       Interrupt # 72  (Vector at memory address 120)











				  - 23 -





     3.3.2.1.13	 Timer

     The Host Board has two timers  in  addition  to  the   Real  Time
     Clock.    They   are   provided   by  an  8254  that  has  4  I/O
     addresses  associated  with it.   The two timers are  called  the
     Watchdog  timer and the Schedule timer.   They both use the  same
     prescaler  but  the Watchdog generates a Non-Maskable   interrupt
     (NMI)  while  the Schedule timer generates interrupt  32.   Their
     addresses  are listed below.   The 8254 is set up by writing   to
     the Control register (see Intel's Data Catalogue).  The time base
     is also given below.

	    Unit	    I/O Address		  Interrupt
	    ----	    -----------		  ---------
	  Prescaler		0F0
	  Watchdog		0F2		  NMI(2)  8
	  Schedule		0F4		   32	 80
	  Control (Write Only)	0F6

		    Time Base = 5.425 * 10 ** -5

     3.3.2.1.14	 Interrupt Controllers

     The Host Board provides a full range of  interrupts  for  various
     system  control  functions.    These  interrupts  are  handled by
     five  8259A Interrupt Controllers.   One  of  these  devices   is
     designated the Master Controller and it has two Slave Controllers
     (Slave 0 and Slave 1) connected to it.   The last two 8259As  are
     used  to  signal  error  conditions in the  Main  Array  and  are
     connected  to Slave 0.   The Main Array Error Controllers must be
     used in polled mode.   The following table lists the controllers,
     their addresses and defines the interrupts they handle.   Section
     3.3.2.1.15  lists  the interrupts and vector addresses  that  are
     generated  by  these controllers.   Programming details  for  the
     8259A can be found in Intel's Data Catalogue.

	  1) Master Interrupt Controller
	       I/O Addresses:
		    C0:	 ICW1,OCW2,OCW3 (byte access only)
		    C2:	 ICW2-4, Mask Register (byte access only)
	       Connected Interrupts:
		     0:	 Schedule Timer
		     1:	 Serial Channel Controller 0
		     2:	 Serial Channel Controller 1
		     3:	 Serial Channel Controller 2
		     4:	 Serial Channel Controller 3
		     5:	 Slave Interrupt Controller 0
		     6:	 Slave Interrupt Controller 1
		     7:	 Reserved (grounded)









				  - 24 -





	  2) Slave Interrupt Controller 0
	       I/O Addresses:
		    C8:	 ICW1,OCW2,OCW3 (byte access only)
		    CA:	 ICW2-4, Mask Register (byte access only)
	       Connected Interrupts:
		     0:	 Real Time Clock
		     1:	 Local Array Error
		     2:	 Main Array Error (see 4 below)
		     3:	 DMA Channel 0 (end of DMA)
		     4:	 DMA Channel 1 (end of DMA)
		     5:	 DMA Channel 2 (end of DMA)
		     6:	 DMA Channel 3 (end of DMA)
		     7:	 Reserved (grounded)

	  3) Slave Interrupt Controller 1
	       I/O Addresses:
		    CC:	 ICW1,OCW2,OCW3 (byte access only)
		    CE:	 ICW2-4, Mask Register (byte access only)
	       Connected Interrupts:
		     0:	 SBX 3 Interrupt
		     1:	 SBX 2 Interrupt
		     2:	 SBX 1 Interrupt
		     3:	 Disk Controller Interrupt
		     4:	 Power Down Interrupt
		     5:	 Printer Interrupt
		     6:	 Temperature Sense Ready Interrupt
		     7:	 Reserved (grounded)

	  4) Main Array Interrupt Controller
	       I/O Addresses:
		    C4:	 ICW1,OCW2,OCW3 (16 bit access only)
		    C6:	 ICW2-4, Mask Register (16 bit access only)
	       Connected Interrupts:
		    Level     Low Data Byte	  High Data Byte
		    -----     -------------	  --------------
		      0	      Board 0 (J20)	  Board 8 (J12)
		      1	      Board 1 (J19)	  Board 9 (J11)
		      2	      Board 2 (J18)	  Board 10 (J10)
		      3	      Board 3 (J17)	  Board 11 (J9)
		      4	      Board 4 (J16)	  Board 12 (J8)
		      5	      Board 5 (J15)	  Board 13 (J7)
		      6	      Board 6 (J14)	  Board 14 (J6)
		      7	      Board 7 (J13)	  Board 15 (J5)















				  - 25 -





     3.3.2.1.15	 Interrupts

     The Host Board generates and handles a complete set of interrupts
     for managing the NCUBE/ten system.  The interrupts are defined in
     the table below.

     Vector #	 Address		Function
     --------	 -------		--------
	0	    00	      Divide Error
	1	    04	      Single Step
	2	    08	      Non Maskable Interrupt (NMI)
	3	    0C	      Breakpoint
	4	    10	      Overflow (detected by INTO instruction)
	5	    14	      Range Bound Exceeded
	6	    18	      Invalid Opcode
	7	    1C	      Processor Extension Not Available
	8	    20	      Interrupt Table Too Small
	9	    24	      Processor Extension Segment Overrun
      10-12	  28-30	      Reserved
       13	    34	      Segment Overrun
      14-15	  38-3C	      Reserved
       16	    40	      Processor Extension Error
      17-31	  44-7C	      Reserved
       32	    80	      Schedule Timer (using vector base 20H)
      33-39	  84-9C	      Reserved
       40	    A0	      Serial Channel 0 Tx Empty
       41	    A4	      Serial Channel 0 Status Change
       42	    A8	      Serial Channel 0 Rx Ready
       43	    AC	      Serial Channel 0 Special Rx
       44	    B0	      Serial Channel 1 Tx Empty
       45	    B4	      Serial Channel 1 Status Change
       46	    B8	      Serial Channel 1 Rx Ready
       47	    BC	      Serial Channel 1 Special Rx
       48	    C0	      Serial Channel 2 Tx Empty
       49	    C4	      Serial Channel 2 Status Change
       50	    C8	      Serial Channel 2 Rx Ready
       51	    CC	      Serial Channel 2 Special Rx
       52	    D0	      Serial Channel 3 Tx Empty
       53	    D4	      Serial Channel 3 Status Change
       54	    D8	      Serial Channel 3 Rx Ready
       55	    DC	      Serial Channel 3 Special Rx
       56	    E0	      Serial Channel 4 Tx Empty
       57	    E4	      Serial Channel 4 Status Change
       58	    E8	      Serial Channel 4 Rx Ready
       59	    EC	      Serial Channel 4 Special Rx
       60	    F0	      Serial Channel 5 Tx Empty
       61	    F4	      Serial Channel 5 Status Change
       62	    F8	      Serial Channel 5 Rx Ready
       63	    FC	      Serial Channel 5 Special Rx
       64	   100	      Serial Channel 6 Tx Empty
       65	   104	      Serial Channel 6 Status Change
       66	   108	      Serial Channel 6 Rx Ready
       67	   10C	      Serial Channel 6 Special Rx
       68	   110	      Serial Channel 7 Tx Empty
       69	   114	      Serial Channel 7 Status Change



				  - 26 -





       70	   118	      Serial Channel 7 Rx Ready
       71	   11C	      Serial Channel 7 Special Rx
       72	   120	      Real Time Clock
       73	   124	      Local Array Error
       74	   128	      Main Array Error
       75	   12C	      DMA Channel 0 (end of DMA)
       76	   130	      DMA Channel 1 (end of DMA)
       77	   134	      DMA Channel 2 (end of DMA)
       78	   138	      DMA Channel 3 (end of DMA)
       79	   13C	      Reserved
       80	   140	      SBX 3 Interrupt
       81	   144	      SBX 2 Interrupt
       82	   148	      SBX 1 Interrupt
       83	   14C	      Disk Controller Interrupt
       84	   150	      Power Down Interrupt
       85	   154	      Printer Interrupt
       86	   158	      Temperature Sense Ready Interrupt
       87	   15C	      Reserved


     3.3.2.1.16	 80287 Math Coprocessor

     The  Host  Board  also  supports  the   80287   Math Coprocessor.
     The  I/O addresses listed below are  activated  by  invoking  the
     80286 Escape opcodes used by the 80287.  The details on the 80287
     are in Intel's Microprocessor Manual.

	  80287 I/O Addresses:	F8 to FF


     3.3.2.1.17	 Initial State

     The Host Board is initialized on  system   reset.    The  initial
     condition of all the state of the board is  zero  except for that
     listed below.























				  - 27 -





     3.3.2.1.18	 System Summary

     The  following tables summarize the memory and I/O address  space
     of the Host Board.

		    Memory Space

	  System Memory (RAM):	       000000 to 1FFFFF
	  Local Array Memory (RAM):    200000 to 3FFFFF
	  Reserved (80286):	       400000 to F7FFFF
	  Reserved (Disk Controller):  400000 to FFFFFF
	  Read Only Memory (EPROM):    F80000 to FFFFFF

		    I/O Space

	  Parallel I/O Section:	       000 to 01F
	  Reserved:		       020 to 037
	  Temperature Sense:	       038 to 03F
	  Real Time Clock:	       040 to 05F
	  SBX 3:		       060 to 07F
	  SBX 2:		       080 to 09F
	  SBX 1:		       0A0 to 0BF
	  Interrupt Controllers:       0C0 to 0CF
	  Serial Channel Controllers:  0D0 to 0EF
	  Timer:		       0F0 to 0F7
	  Math Coprocessor:	       0F8 to 0FF
	  DMA Controller:	       ??? to ???































				  - 28 -





     3.3.2.2  Graphics Board

     A Graphics Board can be installed in any I/O slot (except slot 0)
     and is used to control a raster  scan  CRT  display.   This  will
     provide  a   very   effective way for displaying and dealing with
     the  very large amount of data that can be computed and output by
     the NCUBE system.

     The   graphics  system  consists of a 2048 by 1024 by 8 bit frame
     buffer which is used mode as a double buffer for a  768  by  1024
     bit  display  or  it  can  be  used  to hold a larger picture for
     panning and zooming.  There are three processors  on  the  board:
     an  80186,  an  Hitachi  HD63484 graphics controller and an Intel
     82730 text processor.  There is 128 Kbytes of  local  memory  for
     these  processors.   There are also 16 NCUBE processing  nodes to
     handle output data  from  the  hypercube  array  and  some  local
     numerical display processing.  The color lookup table has 12 bits
     in with 24 bits out yielding 16  million  colors.   The  Graphics
     Board  also has 2 iSBX interfaces for custom devices.  The output
     of the graphics system is standard  RS-343 RGB video data  at  60
     Mhz  dot  rate  and  noninterlaced  60  Hz frame rate that can be
     connected to a high performance color CRT monitor.

     The  I/O channel bandwidth allows the Hypercube array  to  output
     a new  frame of display data in excess of 30 times a second (real
     time rate).   This makes the system ideal for  a  wide  range  of
     graphics applications.


     3.3.2.3  Intersystem Board

     The  Intersystem  Board  allows two or more  NCUBE systems  to be
     interconnected through an I/O channel (an order  7  subcube)   in
     each  system.    This  permits  the  implementation  of arrays of
     NCUBE  systems  including  pipelining  of multiple NCUBE  systems
     where  the output of one machine feeds  the input of the next and
     the last system drives the displays.


     3.3.2.4  System Enclosure

     The enclosure for the NCUBE/ten system is air cooled and comes in
     two  sections   that  are shipped separately and bolted  together
     when installed.   Both  boxes are 34 inches high and  35   inches
     deep.   One   box   is   24  inches  wide  and contains the  disk
     drives,  the cartridge tape unit and associated  fans  and  power
     supplies.    The  other  box  is  28 inches wide and includes the
     backplane, Processor and I/O boards and necessary fans and  power
     supplies.









				  - 29 -





     4	THE PROCESSOR


     4.1  Introduction

     The  processor array is made up of 2**N nodes where N can be from
     4 up to 10 inclusive.  Each processing node consists of a general
     purpose  32 bit processor (including 32 and 64 bit floating point
     instructions), 128K bytes of  ECC  memory  and  11  communication
     channels  to support the  hypercube  interconnection  scheme  and
     the  8  system  I/O channels.


     4.2  Architecture Overview

     We   will  briefly  describe  here  the  major  aspects  of   the
     architecture;  the  details on each topic will be covered in  its
     own  chapter.   The  architectural  components  we  will  discuss
     include
	  1. data representation
	  2. registers, interrupts and communication
	  3. instruction formats and addressing modes.


     4.2.1  Data Representation

     The NCUBE processor recognizes two main classes of data: integers
     and  reals.   Integers are represented in standard 2's complement
     form and come in three types:   byte (B-8 bits),  halfword  (H-16
     bits) and word (W-32 bits).   There are two types of reals.   The
     32 bit format, called real (R), has an 8 bit exponent and 24 bits
     of  significance.   The longreal (L) format is 64 bits with 11 in
     the exponent and 53 in the significand.   The longreal format  is
     used   for   computations  that  need  high  accuracy   and   for
     intermediate   computations   with   real  variables   when   the
     computation is particularly sensitive to roundoff error.  Both of
     these formats conform to the IEEE Binary Floating Point  Standard
     (P754).

     In  addition  to the various data formats,  the  NCUBE  processor
     recognizes  and manipulates addresses.   Addresses are simply  32
     bit  unsigned  values that point to individual bytes in a  linear
     address  space.   The  current implementation  of  the  processor
     supports  only  a  17 bit physical address  space.   Thus  if  an
     address  value  is  larger than 2**17-1 an address  exception  is
     signalled.












				  - 30 -





     4.2.2  Registers, Interrupts and Communication

     The  processor's instructions operate on data in main  memory  as
     described  above or on data in 32 bit registers.   The  processor
     contains  three types of registers:   the general registers,  the
     processor registers and the communication control registers.  The
     16  general  registers  are 32 bits long and are  used  for  both
     operands and addresses.   Since they are general they can be used
     interchangably in all operations and addressing modes.

     The processor registers are  special purpose and can only be read
     or  written by Load Processor Register (LDPR) and Store Processor
     Register (STPR) instructions respectively.  The exact formats and
     detailed  descriptions of these registers are in  section  4.4.3.
     In summary, the processor registers include
	  0.  Stack Pointer (SP)--points to the top of the stack
	  1.  Program Status (PS)--contains flags, interrupt controls
	      and other status information
	  2.  Fault Register (FR)--the fault codes are stored here
	  3.  Configuration Register (CR)--the model number (read
	      only) and memory interface parameters are stored here
	  4.  Processor Identification (PI)--contains a number	that
	      identifies the processor's location in the array
	  5.  Time Out (TO)--contains a counter that is decremented
	      approximately every 100 microseconds and generates an
	      interrupt (if enabled) when it reaches zero
     Processor  registers 6 through 12 are used to signal "ready"  and
     error  conditions  for the I/O channels.   They are described  in
     detail in section 4.4.3.

     The  I/O ports on the NCUBE processor are  unidirectional  Direct
     Memory  Access  (DMA)  channels and each channel has two  32  bit
     write  only  registers:   an  address  register  for  the  buffer
     location and a count register indicating the number of bytes left
     to  send or receive.   Communication is performed by setting  the
     registers  of the desired channel to the appropriate address  and
     data length and then the DMA channel takes over and  communicates
     a message without processor intervention.  Interrupts can be used
     to  signal  when  a channel is available  (i.e.  when  the  count
     reaches  zero  the  channel is "ready").   A  separate  interrupt
     vector  is  provided  to  indicate to a receiver  that  an  error
     occurred during the data transmission.

     In  addition to communication synchronization and error reporting
     the NCUBE processor uses vectored interrupts for
	  1. hardware errors (e.g. multibit memory errors)
	  2. program exceptions (e.g. real overflow)
	  3. software facilities (e.g. trace, timeout)
     When  an  interrupt  occurs the current program status  (PS)  and
     program counter (PC) are pushed on the stack.  Then PS and PC are
     loaded with new values from the appropriate entry (indexed by the
     interrupt number) in the interrupt vector table in low memory.






				  - 31 -





     4.2.3  Instruction Formats and Addressing Modes

     An  instruction consists of an operation code followed  by  zero,
     one or two data references as shown below.


	  ←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←
	  |  Opcode  |	Reference 1   |	  Reference 2	 |
	  ------------------------------------------------
	  low address					high address


     All  instruction operation codes (opcodes) in the NCUBE processor
     are  one byte long.   The first four bits indicate the  operation
     and number of operands (e.g.  ADD: 2 operands, BRANCH: 1 operand)
     while the other four bits denote the operand size and type  (e.g.
     Halfword (integer),  Real (floating point).   This symmetry makes
     an  opcode  map  easy to read and code generation  easier  for  a
     compiler.

     All of the standard instructions are available for each data type
     including arithmetic,  logical,  conversion,  comparison, branch,
     call and trap instructions.   Instructions can be preceeded by  a
     REPEAT  prefix that causes them to be executed repeatedly until a
     termination  condition  is satisfied.   This is a  very  powerful
     facility  for vector and string operations.  Repeats can also  be
     used with both branches and calls in order to execute a block  of
     code repeatedly.   (i.e.  a REPEAT BRANCH is equivalent to a loop
     instruction).   And  for future extension each operand type has a
     reserved "escape" code.

     A  few instructions have no operands (e.g.  BREAKPOINT) and  some
     have only one (e.g.  CALL) but most have two address fields.  All
     address  fields  begin with a one byte mode  selector.   For  all
     modes  involving  the  general  registers  the  first  four  bits
     indicate the mode and the remaining four determine which register
     to  use.   If  there is an offset indicated it follows  the  mode
     selector.   Some  of the modes provided are  literal,  immediate,
     direct  and  indirect with no registers  involved;  and  register
     direct,  register indirect with and without offset, autoincrement
     and  autodecrement  and offset addressing with both  the  program
     counter  (PC) and the stack pointer (SP).   As with  instructions
     there  is a reserved "escape" code defined for the mode  selector
     field.














				  - 32 -





     4.3  DATA REPRESENTATIONS


     The NCUBE processor recognizes two classes of data:  integers and
     reals  (floating  point  numbers).   There  are  three  types  of
     integers and two types of reals.

     4.3.1  Integers

     The  three integer data types are all represented in standard 2's
     complement.   They are called Byte (B), Halfword (H) and Word (W)
     and are 8,  16 and 32 bits long respectively.  The ranges for the
     three integer formats are specified below.

	       Byte (B):  -128 to 127
	       Halfword (H):  -32,768 to 32,767
	       Word (W):  -2,147,483,648 to 2,147,483,647

     Most  instructions  treat  integers as  signed  numbers  but  the
     logical operations (e.g. AND, OR) view their operands as unsigned
     quantities.   Addresses  are  also  treated by the  processor  as
     unsigned values.   The address space is logically a linear set of
     bytes from address 0 to 2**32-1;  thus addresses are unsigned  32
     bit  integers  (Words).   However,  in this implemenation of  the
     processor  the physical address space is 17 bits so  any  address
     larger than 2**17-1 will cause an Address exception (see 4.5).

     4.3.2  REALS

     The floating point implementation in the NCUBE processor conforms
     to the IEEE Binary Floating Point Standard (P754).  That standard
     was designed for reliable and accurate arithmetic--a feature  not
     usually   associated  with  supercomputers.    We  believe   that
     providing  high performance computation includes a  responsiblity
     to deliver clean,  reliable arithmetic.   With the NCUBE floating
     point  arithmetic not only are the rounded results as accurate as
     possible  but it is feasible to compute guaranteed bounds on  the
     errors using the special directed rounding modes.   Also  because
     of  the  high  accuracy of Real (32 bits)  computations  and  the
     availablity  of  Longreal  (64 bits) to back them up  at  crucial
     points,  it  will be possible to run many more programs  in  Real
     precision instead of automatically using Longreal everywhere.
















				  - 33 -





     The   representations  for  the  two  floating  point  types  are
     illustrated   below   including  the  formulas  for   the   value
     represented.   In  the  formulas  "s" is the  sign,  "e"  is  the
     exponent,  "f"  is  the  fraction  and "b" is  the  bias  in  the
     exponent.
	    ←←←←←←←←←←←←←←←←←←←←←←←←
     Real   |s|	  e   |	     f	   |	      b=127
	    ------------------------
	    31	       22	   0


		 ←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←
     Longreal	 |s|	  e	|	f	  |	    b=1023
		 ----------------------------------
		 63		 51		  0


			 VALUE(V)

     1)	 e = 0	    V = (-1)**s*(0.f)*2**(1-b)	    (denormalized)

     2)	 0 < e < 2*b+1	 V = (-1)**s*(1.f)*2**(e-b) (normalized)

     3)	 e = 2*b+1, f = 0   V = (-1)**s*(INFINITY)

     4)	 e = 2*b+1, f <> 0   V = Not-a-number (Nan)

     The   two  formats  are  closely  related,   the   distinguishing
     characteristics   being  the  exponent  range  (defined  by   the
     parameter b) and the fraction precision.   The Real format has 24
     bits   of   precision   (about  7  digits)  with   a   range   of
     approximately  10**(-38) to 10**(38).   The Longreal format has a
     much  wider range--about 10**(-308) to 10**(308)--and  more  than
     twice the precision of Real at 53 bits or about 15 digits.   Thus
     Longreal,  besides  being  a  powerful  standalone  computational
     format,  makes an excellent backup facility for Real calculations
     at  points  in a program where the results are very sensitive  to
     roundoff error.

     The  NCUBE  implementation conforms to the  IEEE  Floating  Point
     Standard  which   was carefully designed to provide accurate  and
     reliable  arithmetic.   The following properties are a result  of
     the standard.
     1)	  Denormalized numbers (e=0) fill the space between  zero  and
     the smallest normalized number.   They provide a far superior way
     of	 dealing  with	underflow  than the typical  "flush  to	 zero"
     response.
     2)	 The implicit bit yields the greatest possible accuracy and is
     one of the two reasons for choosing radix 2.  The other is speed;
     for a given amount of hardware binary will usually be the fastest
     radix.
     3)	  The  offset  (b) was chosen to ensure	 that  all  normalized
     numbers have representable reciprocals.
     4)	 The format was organized to permit very fast comparisions.




				  - 34 -





     5)	  Infinities (e=11...1,	 f=0) were explicitly  represented  to
     allow for handling zero divide and overflow exceptions.
     6)	 When e=11...1 and f<>0 the representation is treated as Not a
     Number  (Nan) and instead of producing a numeric result when used
     as an operand the processor generates an exception.   Nan's  were
     provided  to  allow  for software	extensions  including  runtime
     diagnostics   like	  "uninitialized  variable"  and   to	permit
     potentially  flawed computations like 0/0 to continue in order to
     observe the effect, if any, on the final results.
     7)	 Longreal has greater range and more than double the precision
     of Real to permit exact Real multiply with no threat of  overflow
     or underflow and generally to allow for Longreal accumulations of
     Real computations.

     The  floating point architecture of the NCUBE processor  includes
     much  more  than  the  data representations.   All  of  the  IEEE
     Standard  requirements  are  either met in the  hardware  or  are
     facilitated  in  software.    Among  these  requirements  is  the
     provision of rounding modes.  In the Program Status (PS) register
     are two bits that control the rounding mode in effect.  The modes
     are:
	00)  Round to Nearest Even:  in this mode the closest possible
     result  is	 returned.   If	 there are two then the	 even  one  is
     generated.	 This removes the bias that exists in the more typical
     "round up in the half case" rounding.
	01)  Round Up:	the larger of the two numbers that bracket the
     exact result is returned.
	10)   Round  Down:   this  returns  the	 smaller  of  the  two
     possibilities.
	11)   Round Toward Zero:   the result is the one that  is  the
     smaller in magnitude.

     Another  important facility in the floating point architecture is
     exception handling.  The following faults are recognized:
     1)	 Inexact Result:  when the result of an operation is not exact
     but must be rounded.
     2)	 Underflow:   the result is nonzero and less in magnitude than
     the smallest normalized number.
     3)	 Zero Divide:	the denominator is zero while the numerator is
     nonzero.
     4)	 Overflow:  the rounded result is larger in magnitude than the
     largest representable number.
     5)	  Invalid Operation:   this includes indeterminate  operations
     like 0/0, 0*INFINITY, etc. and the use of a Nan as an operand.

     All  of these exceptions have an associated flag (and Inexact has
     an interrupt enable) in the PS register.   If an exception occurs
     and  its  interrupt is enabled,  the  processor  produces  enough
     information for recovery.   If the interrupt is disabled the flag
     is set and the processor takes predefined action:
     1)	 Inexact Result:  store the rounded result and continue
       (In this implementation only Inexact Result may be disabled.)
     The exceptions and responses are defined in detail in 4.5.





				  - 35 -





     The  floating  point architecture also provides all the  standard
     instructions for all formats:   add,  subtract, multiply, divide,
     compare and conversion.   But in addition there are some  unusual
     but  crucial instructions.   Square root is correctly rounded and
     as  fast as divide.   Remainder is an exact operation and permits
     argument reduction for periodic functions with no roundoff error.


     WARNING:   In order to extract pieces of real or longreal numbers
     (e.g.  exponent, sign) they must be properly aligned as described
     below:
	      1) reals must be on word boundaries (no restriction on
		 registers)
	      2) longreals must be on doubleword (64 bit)  boundaries
		 or if in registers the low order (fraction) part must
		 be in an even numbered register.
     These  restrictions are imposed in order to be able to  implement
     performance  enhancing look ahead capabilities economically.   If
     no  attempt  is made to access reals or longreals in  pieces  the
     restrictions are not necessary but are recommended since  aligned
     data causes the processor to be able to run faster.





































				  - 36 -





     4.4  REGISTERS

     There  are three types of registers in the NCUBE processor:   the
     General registers,  the Input/Output registers and the  Processor
     registers.

     4.4.1  General Registers

     The 16 General registers, labeled R0 to R15, are 32 bits wide and
     are used for data and addresses.  They are consistently symmetric
     with  no  special  designations or uses for any  of  them.   When
     integer data shorter than 32 bits is moved to a General  register
     it is sign-extended to 32 bits.  When data longer than 32 bits is
     stored  in registers,  the low order part of the data goes in the
     designated register, Ri, and the high order part resides in Ri+1.
     The  numbers "wrap around" so that if a Longreal is moved to  R15
     the high order section is found in R0.

     4.4.2  Input/Output Registers

     Each  of  the  11  input and output ports in a  processor  is  an
     independent Direct Memory Access (DMA) channel and has two 32 bit
     registers:   an  address  register and  a  count  register.   The
     address register contains a pointer to the least significant byte
     of the next halfword to be transferred.   If it is an output port
     the data is moved from memory out to the port.  If it is an input
     port the data that has been received from the output port of  the
     sending processor is moved to memory.   In both cases  the  count
     register  is  set to indicate the number of bytes to be  sent  or
     received.   As data is sent or received,  the appropriate address
     and  count registers are incremented and decremented respectively
     by the number of bytes transferred.   When the count reaches zero
     the ready flag in the Input or Output Status register (see below)
     is set and an interrupt generated if enabled.

     The  DMA channels operate independent of instruction  processing.
     They  begin  functioning whenever a count register is  set  to  a
     nonzero  value.  If the address value is larger than 2**17-1, the
     high order bits (above bit 16) are ignored.  All of the ports are
     general  except  one  input and one output  port  are  designated
     "host" (H) and are normally used to communicate with the  outside
     world over the I/O bus to the Host Board or other I/O boards.

     4.4.3  Processor Registers

     The  Processor  registers are the third type of register  in  the
     NCUBE  processor.   All Processor registers are 32 bits wide  and
     contain all the special purpose and miscellaneous information and
     can  only  be  loaded or stored by the  Load  Processor  Register
     (LDPR)   and   Store  Processor  Register   (STPR)   instructions
     respectively.   These  registers  are labeled P0 to P12 but  they
     also have unique names that denote their purpose.






				  - 37 -





     0)	  Stack Pointer (P0,  SP):   the SP contains a pointer to  the
     current top of stack.  The stack grows toward low memory.
     1)	  Program  Status  (P1,	  PS):	 This  register	 contains  the
     information  that	defines the current state of a	program.   The
     format of the PS is shown below:

     ←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←
     | REP  |	 REP REG    |	RC  |  R   R   T  IE  IO  II  TO  CE|
     ----------------------------------------------------------------
     31	     29		   26	   24				   16

     ←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←
     |IV   R   R   R   R  IIX IN  OF  FZ  UF  IX   U   N   Z   V   C|
     ----------------------------------------------------------------
     15								    0


     All  of the fields are one bit except REP (2 bits),  REP  REG  (4
     bits),  and RC (2 bits).	The meanings of the fields are defined
     below (R is "Reserved"):

     FLAGS

	C -- Carry is set on integer operations when there is a	 carry
     out of the most significant position.  It is also set by floating
     point  instructions and integer multiply and divide  to  indicate
     that the result is negative.  This allows the use of the Unsigned
     Branches  to  implement the "unordered" branches required by  the
     IEEE Floating Point Standard.
	V -- Integer  Overflow is set when the integer result  is  too
     large in magnitude for the format.
	Z  -- The Zero flag is set when the integer or floating	 point
     result is zero.
	N -- Negative is set when the integer or floating point result
     is negative.   If there is an Integer Overflow the Negative  flag
     will not agree with the sign bit of the stored result because the
     Negative  flag  is	 set  according to the	actual	result	before
     Overflow is determined.
	U -- The Not Comparable flag is set only when  floating	 point
     values  are  compared  and	 one  or  both	of  the	 operands   is
     Not-a-number (Nan).

     FLOATING  POINT  EXCEPTIONS - The indicated flag is set when  the
     associated exception occurs and if not disabled the corresponding
     interrupt is generated.  (In this implementation only the Inexact
     Result interrupt can be disabled.)	 The exceptions are defined in
     section 4.5.

	IX -- Inexact Result
	UF -- Underflow
	FZ -- Floating Zero Divide
	OF -- Overflow
	IN -- Invalid Operation





				  - 38 -





     INTERRUPT	ENABLE	FLAGS - If a flag is set  and  the  associated
     exception or event occurs an interrupt is generated.   If the bit
     is zero the interrupt is suppressed until the interrupt condition
     is	 cleared  or  the interrupt is enabled.	  The  floating	 point
     interrupt	conditions  are	 cleared as  soon  as  the  subsequent
     instruction begins execution.

	IIX -- Inexact Result Enable
	R ---- Reserved for Underflow Enable
	R ---- Reserved for Zero Divide Enable
	R ---- Reserved for Overflow Enable
	R ---- Reserved for Invalid Operation Enable
	IV --- Integer Overflow Enable
	CE --- Correctable  ECC (when a memory error is corrected  by
     the  processor's ECC logic and this flag is set an	 interrupt  is
     generated; this permits logging the number of memory errors.)
	TO --- Timeout Enable (if this flag is zero the interrupt that
     would  be	generated by a zero value in the Timeout  Register  is
     suppressed.)
	II --- Input  Enable  (if this flag is	zero  any  interrupt
     associated with an input channel is suppressed.)
	IO --- Output Enable (if this flag is zero all output channel
     interrupts are suppressed.)
	IE --- Interrupt Enable (if this flag is zero then all
     interrupts that can be disabled by other flags are disabled)
	T ---- Trace (this flag, if set to one, causes an interrupt as
     soon as the current instruction finishes; this is used for
	 "single
     step" debugging.)

     CONTROL FIELDS

	RC --- Round  Control (this field controls the rounding	 mode
     for floating point operations.)
	  00)  Round to Nearest Even
	  01)  Round Up
	  10)  Round Down
	  11)  Round Toward Zero
	REP -- Repeat Mode (this field indicates the repeat  mode  in
     effect  for the instruction following one of the REPEAT operation
     codes.)
	  00)  No Repeat
	  01)  Repeat while REG is not zero
	  10)  Repeat while REG is not zero and the Z flag is one.
	  11)  Repeat while REG is not zero and the Z flag is zero.
	REP REG -- Repeat Register (if the repeat mode is not 00  then
     every  time  the instruction following the repeat-type  operation
     code    is executed the value in REG is decremented;  REG can  be
     any of the General registers.)









				  - 39 -





     2)	  Fault	 Register  (P2,	 FR):	When the  processor  takes  an
     interrupt	generated  by  an  exception  this  register  contains
     information to aid recovery.  The Fault Register is Read-Only and
     is only set after the first floating point operation.  Its format
     is shown below.

     ←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←
     | R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R|
     ----------------------------------------------------------------
      31							  16

     ←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←
     | R   R   R   R   R  S2  I2  E2  F2  S1  I1  E1  F1  GR  RS  RU|
     ----------------------------------------------------------------
      15							   0


	  RU -- Rounded Up (1 means result rounded up)
	  RS -- Round OR Sticky bit
	  GR -- Guard bit
						      ←←←←
	  F1 -- Fraction (F1 = 1 means fraction = 0)	 |
	  E1 -- Exponent (E1 = 1 means exponent = 0)	 | First
	  I1 -- Invalid (I1 = 1 means exponent = 11...1) | Operand
	  S1 -- Sign (S1 = sign of fisrt operand)	 |
						      ----
						      ←←←←
	  F2 -- Fraction (F2 = 1 means fraction = 0)	 |
	  E2 -- Exponent (E2 = 1 means exponent = 0)	 | Second
	  I2 -- Invalid (I2 = 1 means exponent = 11...1) | Operand
	  S2 -- Sign (S2 = sign of second operand)	 |
						      ----
	  R --- Reserved

     The  Guard,  Round and Sticky bits are the hardware bits that are
     used for rounding in floating point operations as defined in  the
     IEEE  Binary Floating Point Standard.   The  Fraction,  Exponent,
     Invalid and Sign bits for each operand allow an interrupt handler
     to determine if the operand is Nan,  infinity,  denormal, zero or
     "ordinary"	 (valid,  nonzero)  and its sign without decoding  the
     instruction.

















				  - 40 -





     3)	 Configuration Register (P3,  CR):   This register is used  to
     set  various configuration parameters including the Model	Number
     which is a Read-Only field.  The format of the CR is:

     ←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←
     |		MODEL NUMBER	     |		NCUBE RESERVED	    |
     ----------------------------------------------------------------
      31			   24				  16

     ←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←
     |	NCUBE RESERVED	| TYPE	|  CYC	|	    REFR	    |
     ----------------------------------------------------------------
      15	     12	 11  10	  9   8	  7			   0


	  REFR -- Indicates the external DRAM refresh rate.  With a
		  processor cycle time of 10 Megahertz:
		    rate = (REFR)*(0.8 microseconds)
		  The typical refresh rate is about 15.625
		  microseconds which requires that REFR = 19 (REFR
		  is set to 4 by the initialization microcode).
	  TYPE -- This allows for different memory types
	       00)    64K RAM (4 x 16K) (32 KBytes/node)
	       01)   256K RAM (4 x 64K) (128 KBytes/node)
	       10)  1024K RAM (4 x 256K) (512 KBytes/node)
	       11)  Reserved
	  CYC --- This field specifies the memory speed
	       00)  300 nsec
	       01)  200 nsec
	       10)  Reserved
	       11)  Reserved
	  NCUBE RESERVED -- These bits are reserved for future use  by
			    NCUBE.
	  MODEL	 NUMBER -- This	 field	is set	by  the	 manufacturing
			   process  and is read only.	It is used to
			   distinguish	different versions of the
			   processor.


     4) Processor Identification Register (P4,	PI):  The PI is set by
     the  operating system at initialization and allows processors  to
     identify  themselves.   The high order bit (31) is Read-Only  and
     indicates	whether the processor is in the hypercube array (0) or
     on	 an Interface Board (1).   The rest of the bits	 indicate  the
     address  or  position  of	the processor in the array  or	on  an
     Interface Board.

     5)	 Timeout  Register  (P5,   TR):	   Approximately   every   100
     microseconds  (at 10 Mhz)	the unsigned value in this register is
     decremented.   (It can count for about 5 days.)   If the  Timeout
     Register is 0,  an interrupt is generated whenever it is
	 enabled.
     Decrementing stops when the value in the Timeout reaches zero.





				  - 41 -





     6)	 Output Ready (P6, OR):	 There is a Ready flag for each output
     channel.  When the flag is set to one it indicates that the count
     register  for  that channel is zero and the channel is  ready  to
     transmit more data. The format of the register is

     ←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←
     |OH   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R|
     ----------------------------------------------------------------
      31							  16

     ←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←
     | R   R   R   R   R   R  O9  O8  O7  O6  O5  O4  O3  O2  O1  O0|
     ----------------------------------------------------------------
      15							   0


     where  OH means Output Host,  R is Reserved for future  expansion
     and  Oi  is the Output port number i.   The OR register  is  read
     only.

     7)	 Input Ready (P7,  IR):	  For each input port there is a  flag
     which  when  set indicates that the corresponding count  register
     has gone to zero,	the channel has completed its DMA function and
     is now ready to receive more data.	 The format of the register is
     the  same	as  the	 Output Ready register	except	I  (Input)  is
     substituted for O (Output).  The IR register is read only.

     8)	 Output Enable (P8, OE):  This register has the same format as
     the  Output  Ready	 register  but the  meaning  of	 the  flag  is
     different.	  If  a	 flag is set to one an interrupt is  generated
     when the corresponding output channel is ready to transmit.   The
     interrupt	is  suppressed if the flag is zero or  if  the	Output
     enable (OI) flag in the Program Status register is zero.

     9)	  Input Enable (P9,  IE):   When an input count	 register  has
     become zero and the channel is ready to receive,  an interrupt is
     generated	if  the corresponding flag in this register is set  to
     one.   If	the flag is zero or the Input enable (II) flag in  the
     Program Status register is zero the interrupt is suppressed.

     10)  Input Pending (P10,  IP):  If the count register of an input
     port  is  zero but there is a halfword in the port that  has  not
     been stored in memory,  the corresponding bit in this register is
     set to one.  This register is read only.

     11)   Input Parity Error (P11,  PE):   Every halfword received is
     checked  for  parity.   If an error is detected  then  after  the
     transmission  is  complete	 (the  count  register	becomes	 zero)
     instead of generating a "ready" interrupt, the corresponding flag
     in	 this  register	 is  set and an	 "input	 error"	 interrupt  is
     generated.	 This register is read only.







				  - 42 -





     12)   Input Overrun Error (P12,  IO):   If a halfword is received
     and  overwrites a previously received halfword before it  can  be
     stored in memory an error is noted.  After the count goes to zero
     instead of signalling a "ready" interrupt, the corresponding flag
     is set to one and an "input error" interrupt is generated.	  This
     register is read only.




















































				  - 43 -





     4.5  INTERRUPTS AND EXCEPTIONS

     The  NCUBE processor has a powerful vectored  interrupt  facility
     and  generates several kinds of interrupts:   program exceptions,
     software  facilities,  I/O	 signals  and  hardware	 errors.   The
     program exceptions include integer overflow and zero divide,  the
     floating  point  exceptions,   stack  overflow  and  address  and
     reserved  opcode faults.	The software facility  interrupts  are
     trap, breakpoint and trace.  The Input Ready, Output Ready, Input
     Parity  and Input Overrun interrupts are the  I/O	signals.   And
     the hardware errors are Corrected and Uncorrectable memory errors
     and Processor Self Test errors.

     All   interrupts  (including  the	TRAP  and  breakpoint	(BKPT)
     instructions)  have  the same convention.	 There is an  unsigned
     number  associated with the interrupt (the argument of  the  trap
     instruction)  that	 is multiplied by eight to give	 the  absolute
     location  in low memory of the interrupt vector.	Each vector is
     eight  bytes;  the first four bytes contain the absolute  address
     vector  (VA) of the interrupt handing routine and the  next  four
     bytes are a new Program Status (NPS) value.  When an interrupt is
     generated	the processor pushes the Program Counter (PC) and  the
     Program  Status  (PS)  on	the stack,  sets  the  Program	Status
     register  to NPS and the Program Counter register to VA.	If the
     interrupt is signalling a program exception (interrupts 3 through
     12, see below) instead of saving the PC, the processor pushes the
     address of the offending instruction ("previous PC") on the stack
     so	 that the exception handler can decode the  instruction.   One
     reason  decoding  may be necessary is because the	IEEE  Floating
     Point Standard requires the ability to construct a result,	 store
     it	 where	the  instruction  would have  and  then	 continue  the
     computation.   When the interrupt handler is finished it executes
     a	Return from Interrupt (RETI) instruction that pops the old  PS
     and  PC values off the stack and into their respective registers.
     A	TRAP instruction with the appropriate number as	 its  argument
     can  simulate any interrupt (except that the PC is always	pushed
     on the stack with TRAP regardless of its argument).





















				  - 44 -





     All interrupts are defined below.	 The number at the left is the
     interrupt number.

     4.5.1  Interrupt Definitions

	0) RESERVED
	1) T:	Trace--at the end of the current instruction interrupt
		1 is generated in order to facilitate single step
		debugging.
	2) BK:	Breakpoint--when  the  one byte	 instruction  BKPT  is
		executed an interrupt 2 is generated; this is used for
		breakpoint debugging.
	3) IV:	Integer	 Overflow--when	 the result is	too  large  in
		magnitude for the destination format.
		   add/subtract:  when the carry does not equal the
				  sign bit
		   multiply:  when the high order half of the product
			      is not equal to the sign extension of
			      the result
		   divide:  when the most negative number is divided
			    by -1
		The interrupt can be disabled but in either case the
		result stored in the destination is the low order
		part of the result (in divide it is the dividend).
	4) IZ:	Integer Zero Divide--when the denominator of an
		integer divide or remainder is zero this interrupt
		is generated and no result is stored.
	5) IX:	Inexact Result--when a real result must be rounded the
		flag is set in the PS and if not disabled the
		interrupt  is  generated.  In either case the
		correctly rounded result is first stored at the
		destination.  Inexact Result may occur at the same
		time as either Overflow or Underflow.  If this occurs
		the Inexact flag is set but the interrupt is
		suppressed and either the Overflow or the Underflow
		interrupt is generated.
	6) UF:	Underflow--if a real result is not zero but is smaller
		in magnitude than the format's smallest normalized
		number then the UF flag is set in the PS and an
		interrupt generated.  However, an encoded result (the
		offset is added to the exponent) is first stored at
		the destination.
	7) FZ:	Floating Zero Divide--when division of a nonzero real
		number by zero is attempted no result is stored, the
		FZ flag is set in the PS and an interrupt is
		generated.
	8) OF:	Overflow--if a real result is larger in magnitude than
		the largest normalized number then an encoded result
		(the offset is subtracted from the exponent) is stored
		and an interrupt is generated.








				  - 45 -





	9) IN:	Invalid Operation--the conditions that cause the IN
		flag in the PS to be set and interrupt 9 to be
		generated are:
		   a) if a real operand has an exponent of all ones
		      (except for branch on unsigned comparison or
		      branch on equal or unequal)
		   b) if both operands of a floating point divide are
		      zero
		   c) if the "divisor" in a floating point remainder
		      operation is zero
		   d) if the operand of square root is negative
	10) UC: Unimplemented Opcode--when one of the reserved opcodes
		is used this interrupt is generated.
	11) AE: Address Error--if an address is larger than 2**17-1
		then interrupt 11 is signalled.
	12) SO: Stack Overflow--when the stack pointer becomes less
		than 2048 this interrupt is generated.	This keeps the
		stack from growing into the interrupt vector area in
		low memory.
	13) TO: Time Out--when the Time Out register is decremented to
		zero interrupt 13 is generated.
	14) CE: Corrected Memory (ECC) Error--if a memory error is
		corrected during the execution of an instruction, at
		the end of the instruction this interrupt is
		generated.  This is useful for logging memory errors.
	15) UE: Uncorrectable Memory (ECC) Error--if a memory  error
		occurs that cannot be corrected this interrupt is
		generated.  Since this could occur at many points
		during the execution of an instruction, the  state of
		the machine is undefined after this error.  If this
		error recurs before the previous one is handled
		then the internal ERROR flag is set and the ERROR
		pin is set high.  This is to warn of a potentially
		fatal condition.
	16) OE: Operand Error--if a literal or immediate is used as
		the destination of a result or any mode other than
		Register Direct is used with a Repeat instruction
		then interrupt 16 is generated.
	17-31)	RESERVED
	32-41)	OR: Output Ready--when the count register of an output
		    port has gone to zero and the channel is ready to
		    send another message, the corresponding bit in the
		    OR register is set and an interrupt generated if
		    it is not suppressed either in the PS (Program
		    Status) register or the OE (Output Enable)
		    register.
	42-62)	RESERVED











				  - 46 -





	63)	ORH: Output Ready Host--this is the interrupt that is
		     used with the output port that is normally used
		     for communicating with the host (i.e. the various
		     interface boards).
	64-73)	IR: Input Ready--these are the interrupts used to
		    signal that an input channel is ready to receive a
		    message.
	74-94)	RESERVED
	95)	IRH: Input  Ready Host--this interrupt is used with
		     the input	channel that is usually used for
		     communicating with the host.
	96-105) IE: Input Error--if either a parity or an overrun
		    error is detected while receiving a message, after
		    the completion the appropriate one of these
		    interrupts is generated.
	106-126)  RESERVED
	127)   IEH:  Input Error Host--if an error is detected on the
		     channel used for host communication this
		     interrupt is generated.


     4.5.2  Error Flag

     There  is	an internal Error flag that is tied to the  Error  pin
     that indicates that the processor is in an unknown,  inconsistent
     or	 failure state.	  On resetting the processor the Error flag is
     initialized to one and if the on-chip initialization sequence and
     subsequent diagnostic software run successfully it can be cleared
     by	 software (EROF).   It is also set by  consecutive  unserviced
     Uncorrectable ECC errors.	The Error flag and pin can also be set
     and reset by the ERON and EROF instructions respectively.



























				  - 47 -





     4.6  COMMUNICATION


     There  are	 22  unidirectional direct  memory  access  (DMA)  I/O
     channels on each NCUBE processor, 11 for input and 11 for output.
     The  Input ports are numbered 0,1,...,9 and 31;  while the Output
     ports  are	 numbers 32,33,...,41 and 63.	The input  and	output
     ports are normally used in pairs as shown below

		 {(0,32),(1,33),...,(9,41),(31,63)}

     to	 form  11  full	 duplex I/O channels.	Ports 31  and  63  are
     normally  used for communicating with a Host Board or  any	 other
     I/0  Board.   Ports 0 to 9 and 32 to 41 are  used	to  build  the
     hypercube	interconnection network.  Port numbers 10 to 30 and 42
     to 62 are reserved for future expansion.

     Each  of  the  I/O channels has  an  address  register,  a	 count
     register,	a  "ready"  flag  and an interrupt  enable  flag.   In
     addition  each input channel has a parity error flag,  an overrun
     error flag and a "DMA pending" flag.  Besides the enable for each
     channel  there are two global enable flags in the Program	Status
     (PS)  register.   The  II	flag  disables	all  input  interrupts
     (including	 errors)  even if the corresponding  channel  flag  is
     enabled and the IO flag disables all output interrupts.

     In order to send a message from a memory buffer on a given output
     channel  one  first either checks its ready flag or  enables  its
     interrupt	and  waits for a "ready" interrupt.   As soon  as  the
     channel  indicates that it is ready (idle),  the address register
     is	 set to point to the first (low) byte of  the  message,	 which
     must  begin  on  an  even boundary,  by executing	a  LPTR	 (Load
     Pointer) instruction.   The source operand of this instruction is
     the  address of the message buffer and the destination operand is
     an integer whose value determines which of the channel  registers
     is to be loaded:

	  0,1,...,9,31	    are input channels (10,11,...30 are
			    reserved)

	  32,33,...,41,63   are	 output	 channels  (42,43,...,62 are
			    reserved).
















				  - 48 -





     In order to start the automatic message output, the corresponding
     count register must be set to the number of bytes in the message.
     (In  this	version	 of the NCUBE processor the low order  bit  is
     forced to zero in both the address and the count registers;  thus
     the message buffer must start on an even byte boundary and be  an
     even  number of bytes long.   No error is signalled if a  program
     violates  this  requirement.)  This is done by executing  a  LCNT
     (Load Count) instruction.	 The destination operand indicates the
     register to be loaded as explained above for the LPTR instruction
     and  the  source operand is the count value (an unsigned  32  bit
     integer). The LCNT instruction also resets the parity and overrun
     error  flags  when	 setting  up  an  input	 port.	  The  message
     transmission  is  automatic  and  as data	is  sent  the  address
     register  is  incremented	and the count is  decremented  by  the
     number  of	 bytes transferred.   When the count becomes zero  the
     output  stops,  the  ready flag is set and if enabled  the	 ready
     interrupt is generated.

     In	 addition to being able to send a message on a single channel,
     the NCUBE processor has a powerful BROADCAST facility.   In order
     to send a message over several channels at once,  one must	 first
     ensure  that the desired output channels are ready.   Then a BPTR
     (Broadcast Pointer) instruction is executed.   Its source operand
     is	 the  address of the message as in LPTR	 but  its  destination
     operand is a 32 bit mask.	 Every bit position that is set to one
     will  cause the corresponding output channel address register  to
     be	 loaded.   (Bit	 position 0 corresponds to output channel  32,
     position 1 to channel 33, etc.)  The message broadcast is started
     by	  executing  a	BCNT  (Broadcast  Count)   instruction	 whose
     destination  operand  is a mask as explained above for  the  BPTR
     instruction  and  whose  source  operand is an  unsigned  32  bit
     integer equal to the number of bytes in the message.   The	 major
     advantage	of broadcasting is that the sending processor only has
     to	 access each transmitted datum once thus reducing  the	memory
     bandwidth	used  by  the DMA facility.   The processor  can  only
     handle  one broadcast at a time so if a subsequent	 broadcast  is
     attempted,	 even on different channels, before the current one is
     finished the results for both will be undefined.

     In	 order	for  a	message to  be	transmitted  successfully  the
     corresponding input channel of the receiving processor must first
     be	 set up with an address to an input buffer and the same	 count
     as	 the output channel.   One way this can be accomplished is  by
     using  a software protocol that always sends a single halfword as
     the  length of the desired message and waiting for the  receiving
     processor	to respond with a halfword code that indicates "ok  to
     send message".  This protocol will work because the last halfword
     that  is  sent remains available for DMA even  if	the  receiving
     processor's  input channel is uninitialized (count = zero).   The
     presence  of this data in the input channel is indicated  by  the
     corresponding bit in the INPUT DMA PENDING register (which can be
     tested  by	 software)  being  set.	  Thus as soon	as  the	 count
     register is set to two, the halfword (either the length or an "ok
     to send") is stored in memory.




				  - 49 -





	  WARNING:  Before attempting to DMA the data to memory that
	  is in an uninitialized input port the error (Overrun and
	  Parity) flags must first be checked or they will be lost.
	  This is because the Load Count instruction clears the error
	  flags.

     The  processor recognizes two types of errors  in	communication.
     Each halfword is sent with a parity bit and on reception a parity
     check is made.  Also if a halfword is received into a DMA channel
     before  the  previous  one is stored in memory an	input  overrun
     error is detected.	  (Overrun can occur when the input count goes
     to	 zero before the output count--a software error,  or when  too
     many messages are being sent to the processor at the same	time.)
     If	 either type of error occurs the corresponding flag is set and
     when the input count reaches zero instead of "ready",  an	"input
     error"  interrupt is generated (if II is set).   A software error
     that  is  not detected by the processor occurs  when  the	output
     count is smaller than the input.  In that case, after the message
     is	 sent the input channel will simply hang.   This condition can
     be	 avoided  by  correct  software	 or  by	 setting  up   timeout
     conditions using the Timeout Register.

     Messages are sent in packets of 18 bits.  Each packet consists of
     one start bit,  16 data bits starting with the Least  Significant
     Bit, and ending with a parity (odd parity) bit.

































				  - 50 -





     4.7  INSTRUCTION FORMATS AND ADDRESSING MODES


     The  NCUBE processor is designed to be as simple and symmetric as
     possible.	 Most  instructions work on all supported data	types;
     the General registers are interchangable in all  operations;  all
     address modes work with all instructions including Branches.   An
     instruction  consists  of an operation code (opcode) followed  by
     zero,  one	 or two address fields.	  The representation of a  two
     address instruction in memory is illustrated below:

	←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←
	|   OPCODE   |	   REFERENCE 1	 |    REFERENCE 2     |
	-------------------------------------------------------
	low address					  high address

     In	 the  physical representation shown above REFERENCE 2 is  both
     one of the operands and the result.   For example,	 if the OPCODE
     indicated Subtract then the operation performed would be

	  REFERENCE 2  -  REFERENCE 1  --->  REFERENCE 2

     The  assembly  language operand ordering convention is the	 same.
     For example, if the following operations are written

	SUBW  A,B      DIVL  A,B       REMR  A,B       SFTW  A,B

     then the operations performed are

       (B - A)-->B    (B / A)-->B    (B rem A)-->B   sft(B) by A-->B

     The  order of address evaluation is from the low address so  that
     the address for A is evaluated before the address for B.


     4.7.1  Opcode Formats

     All  opcodes are one byte long and each operation type group  has
     at	 least one reserved code for future expansion.	 The  byte  is
     divided into two fields of four bits each.	  The first field, TP,
     specifies	the  length  and  type of the  operands	 (e.g.	8  bit
     integer,  32 bit real) and the second field,  OP,	determines the
     operation and number of operands (e.g. Add--2 operands, Call--one
     operand).	 Each  of  the operations is described	in  detail  in
     chapter  4.8  but most are evident from their name in the	opcode
     table  below.   The first field is represented horizontally  with
     the  even	values	above the odd values.	The  second  field  is
     displayed vertically and is repeated twice.
		       ←←←←←←←←←←←←←←
	       Opcode: | OP	TP  |
		       --------------
		       7	    0






				  - 51 -






			     OPCODE MAP

				 TP
			       ------
	      B	    H	  W	      R	    L
	    ----------------------------------------------
	      0	    2	  4	6     8	    A	  C	E
	    ----------------------------------------------
	 0  MOVB  MOVH	MOVW   RES  MOVR  MOVL	 RES   RES
	 1  NEGB  NEGH	NEGW   RES  NEGR  NEGL	 RES   REP
	 2  SBRB  SBRH	SBRW   RES  SBRR  SBRL	 RES  REPZ
	 3  CMPB  CMPH	CMPW   RES  CMPR  CMPL	 RES REPNZ
	 4  ADDB  ADDH	ADDW   RES  ADDR  ADDL	 RES  TRAP
	 5  ADCB  ADCH	ADCW   RES  SQTR  SQTL	 RES   RES
	 6  SUBB  SUBH	SUBW   RES  SUBR  SUBL	 RES   RES
     OP	 7  SBBB  SBBH	SBBW   RES  SGNR  SGNL	 RES   RES
	 8  MULB  MULH	MULW   RES  MULR  MULL	 RES   RES
	 9  DVRB  DVRH	DVRW   RES  DVRR  DVRL	 RES   RES
	 A  REMB  REMH	REMW   RES  REMR  REML	 RES   RES
	 B  DIVB  DIVH	DIVW   RES  DIVR  DIVL	 RES   RES
	 C  BITB  BITH	BITW   RES   RES   RES	 RES   RES
	 D   RES   RES	 RES   RES   RES   RES	 RES   RES
	 E   RES   RES	 RES   RES   RES   RES	 RES   RES
	 F   RES   RES	 RES   RES   ESC   ESC	 ESC   RES
	    ←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←
       TP    1	   3	 5     7     9	    B	  D	F
	    ----------------------------------------------
	 0  SFTB  SFTH	SFTW   RES  CVBR   NOP	 RES	BG
	 1  SFAB  SFAH	SFAW   RES  CVHR   CLC	 RES   BLE
	 2  ROTB  ROTH	ROTW   RES   RES   STC	 RES   BGU
	 3  FFOB  FFOH	FFOW   RES  CVLR   CMC	 RES  BLEU
	 4  ANDB  ANDH	ANDW   RES  CVBL  ERON	 RES   BGE
	 5   ORB   ORH	 ORW   RES  CVHL  EROF	 RES	BL
	 6  XORB  XORH	XORW   RES  CVWL  BKPT	 RES  BGEU
     OP	 7  NOTB  NOTH	NOTW   RES  CVRL  RSET	 RES   BLU
	 8  ADCD   RES	LDPR   RES  CVBW    EI	 RES   BNE
	 9  SBBD   RES	STPR   RES  CVHW    DI	 RES	BE
	 A   RES   RES	LCNT   RES  CVWB  WAIT	 RES   BNV
	 B   RES   RES	LPTR   RES  CVWH   RES	 RES	BV
	 C   RES   RES	BCNT   RES   RES  RETI	 RES  CALL
	 D   RES   RES	BPTR   RES   RES  RETT	 RES   JMP
	 E   RES   RES	MOVA   RES   RES   RET	 RES  RETP
	 F   ESC   ESC	 ESC   ESC   ESC   ESC	 ESC   ESC
	    ----------------------------------------------













				  - 52 -






     The  Opcode  Map  illustrates  a number of	 symmetries  that  are
     explained in the table below.

	  OPERATIONS		 OPERANDS, (#,TYPE)	  COLUMNS
	  -------------------------------------------------------
	  Special		     0			     B
	  Special		     1, Byte or Halfword     E
	  Branch		     1, Word (Address)	     F
	  Conversion		     2, Mixed		     9
	  Byte			     2, Byte		    0,1
	  Halfword		     2, Halfword	    2,3
	  Word			     2, Word		    4,5
	  Reserved for Doubleword    *,*		    6,7
	  Real			     2, Real		     8
	  Longreal		     2, Longreal	     A
	  Reserved for Extendedreal  *,*		     C
	  Reserved (Arbitrary)	     *,*		     D








































				  - 53 -





     4.7.2  Addressing Modes

     If	 an instruction has operands the address fields always have at
     least  one	 byte.	 The first byte,  called the  Mode  Specifier,
     encodes the addressing mode.   For most modes the first four bits
     specify   the  general  register  to  be  used  in	 the   address
     evaluation	 while	the next four bits  indicate  the  mode.   The
     format is as shown below:
			      ←←←←←←←←←←←←←←←←
	   MODE SPECIFIER:    |	 MD	REG  |
			      ----------------

     The modes are listed below with their encodings and mnemonics.

		    Addressing Mode Table

     Mode Name			      Encoding		 Mnemonic
     ------------------------------------------------------------
      Literal			     0,1,2,3  literal	   #n
      Register Direct			C	Rn	   Rn
      Register Indirect			4	Rn	  (Rn)
      Autodecrement			D	Rn	 -(Rn)
      Autoincrement			6	Rn	  (Rn)+
      Autoincrement Indirect		7	Rn	 @(Rn)+
      Autoskip				5	Rn	  (Rn)++
      Offset+Register
	Byte Offset			8	Rn	  A(Rn)
	Halfword Offset			9	Rn	  A(Rn)
	Word Offset			A	Rn	  A(Rn)
      (Word Offset+Register)Indirect	B	Rn	 @A(Rn)
      RESERVED				E
      Special Modes: no General Register
       Offset+PC
	 Byte Offset+PC			F	0	  A(PC)
	 Halfword Offset+PC		F	1	  A(PC)
	 Word Offset+PC			F	2	  A(PC)
       (Word Offset+PC)Indirect		F	3	 @A(PC)
       Offset+SP
	 Byte Offset+SP			F	4	  A(SP)
	 Halfword Offset+SP		F	5	  A(SP)
	 Word Offset+SP			F	6	  A(SP)
       (Word Offset+SP)Indirect		F	7	 @A(SP)
       Direct
	 Byte Offset			F	8	  A
	 Halfword Offset		F	9	  A
	 Word Offset			F	A	  A
       (Word)Indirect			F	B	 @A
       Push/Pop				F	C	  STK
       Immediate			F	D	   #n
       RESERVED				F	E
       ESCAPE				F	F







				  - 54 -





     We	 will now describe the addressing modes in  detail.   However,
     first there are some global points to remember:

	1) addresses of multibyte operands refer to the low order byte
	   of the operand
	2) offsets are sign-extended to 32 bits before being used in
	   effective address calculation
	3) for Branch and Call instructions in Literal mode the value
	   is added to the PC; for Register Direct mode the register
	   contents are added to the PC; for all other modes the
	   address of the operand simply replaces the PC.

     Literal	 00xxxxxx   (Mode = 0,1,2,3)

     Since the encoding for literal includes modes 0,1,2,3,  there are
     six  bits	for  the definition of the  literal  value.   For  all
     instructions   the	 six  bits  are	 treated  as  a	 standard  2's
     complement	 integer  between  -32 and +31.	  If  the  instruction
     expects  a	 floating  point operand,  the	integer	 is  converted
     implicitly	 (without roundoff error) to the  equivalent  floating
     point value.

     If	 a  literal  is	 used  in  a  Branch,  Call  or	 Move  Address
     instruction,  the	literal is added to the PC  (i.e.  a  relative
     Branch or Call results).	If a literal (or immediate) is used as
     a destination an Operand Error is signalled.

		      ←←←←←←←←←←←←←←←←
     Register Direct  |	  C	 Rn  |
		      ----------------

     In this mode the operand is contained in the indicated  register.
     The value is interpreted according to the instruction:   real for
     floating  point instructions,  integer for integer operations and
     bit  string for logical instructions.   If a longreal operand  is
     expected  the low order part is in Rn and the high order part  in
     Rn+1.  When a byte or halfword is moved to a register it is sign-
     extended.

			←←←←←←←←←←←←←←←←
     Register Indirect	|   4	   Rn  |
			----------------

     The indicated register contains the address of the low order byte
     of the operand.













				  - 55 -





			←←←←←←←←←←←←←←←←
     Autodecrement	|   D	   Rn  |
			----------------

     The  indicated register is decremented by the length in bytes  of
     the  operand  and	then the contents become the  address  of  the
     operand.	This mode can be used to build a software stack or  to
     access consecutive array elements.

			←←←←←←←←←←←←←←←←
     Autoincrement	|   6	   Rn  |
			----------------

     The  data	addressed  by  Rn is first accessed  and  then	Rn  is
     incremented by the number of bytes in the operand.	  This mode is
     used  to step through arrays and,	with Autodecrement,  to	 build
     software stacks.

			     ←←←←←←←←←←←←←←←←
     Autoincrement Indirect  |	 7	Rn  |
			     ----------------

     The  register Rn points to a 32 bit value that is the address  of
     the operand.   After the operand is accessed Rn is incremented by
     four, since addresses are four bytes long.

	       ←←←←←←←←←←←←←←←←
     Autoskip  |   5	  Rn  |
	       ----------------

     After the operand addressed by the contents of Rn is fetched, the
     value  in Rn+1 is added to Rn.   (If n=15 then n+1=0.)  This mode
     allows  for automatically skipping through an array by an	amount
     (in Rn+1) that can be calculated during program  execution.   For
     example  if  a  matrix  is stored by columns  this	 mode  permits
     automatic references to successive row elements.

			←←←←←←←←←←←←←←←←
     Offset + Register	| 8,9,A	   Rn  |    8=byte, 9=halfword, A=word
			----------------

     This  mode	 calculates the address of the operand by  adding  the
     value in Rn to the offset which is a signed integer whose	length
     is determined by the mode setting (8=byte,	 9=halfword,  A=word).
     The  offset immediately follows the mode indicator and  is	 sign-
     extended for the effective address calculation.   These modes are
     also  available for the PC and SP in place of a general  register
     (see below).










				  - 56 -





				   ←←←←←←←←←←←←←←←←
     (Offset + Register) Indirect  |   B      Rn  |	 Word Offset
				   ----------------

     The  contents of Rn are added to the offset (in this mode only  a
     32 bit offset is allowed) and the 32 bit value at that address is
     the  address  of the operand.   This mode is also available  with
     either PC or SP instead of a general register (see below).

		  ←←←←←←←←←←←←←←←←
     Offset + PC  |   F	    0,1,2|	  0=byte, 1=halfword, 2=word
		  ----------------

     The   address  is	calculated  by	adding	the  address  of   the
     instruction  (the value of PC before the current  instruction  is
     executed) to the sign-extended value of the offset which can be a
     byte,  halfword  or word.	 This mode is used to access  operands
     relative  to PC and with branch instructions to jump relative  to
     PC.   (The Literal mode with branch instructions also is relative
     to PC.)  This permits compiling position independent code.

			     ←←←←←←←←←←←←←←←←
     (Offset + PC) Indirect  |	 F	 3  |	      Word Offset
			     ----------------

     The  address of the instruction (the contents of PC) is added  to
     the  word	offset	and the 32 bit value at that  address  is  the
     address of the operand.

		  ←←←←←←←←←←←←←←←←
     Offset + SP  |   F	    4,5,6|	  4=byte, 5=halfword, 6=word
		  ----------------

     The  address is calculated by adding the SP and the sign extended
     offset.   The offset can be a byte, halfword, or word.  This mode
     is	 often used to access local variables in an activation	record
     on the stack.

			     ←←←←←←←←←←←←←←←←
     (Offset + SP) Indirect  |	 F	 7  |	      Word Offset
			     ----------------

     The  SP  and the word offset are added together and  the  32  bit
     value at that address is the address of the operand.

	     ←←←←←←←←←←←←←←←←
     Direct  |	 F     8,9,A|		 8=byte, 9=halfword, A=word
	     ----------------

     The  address is the unsigned value of the offset (byte,  halfword
     or word depending on the mode) that follows the mode specifier.







				  - 57 -





	       ←←←←←←←←←←←←←←←←
     Indirect  |   F	   B  |		      Word Indirect
	       ----------------

     The word that follows the mode specifier points to a 32 bit value
     that is the address of the operand.

		←←←←←←←←←←←←←←←←
     Immediate	|   F	    D  |		Value
		----------------

     In	 this  mode  the  operand follows  the	mode  specifier.   For
     arithmetic and logical operators the length and type of the value
     is	 indicated by the instruction.	 Thus,	ADDB (Add  Byte)  will
     assume  an	 8 bit signed integer while MULL  (Multiply  Longreal)
     will  expect  to  find  a 64 bit floating point  operand  as  the
     "value".  An immediate operand used with a Branch or Move Address
     instruction  causes an invalid operand fault.   If this  mode  is
     used  as  the  destination (the second address in a  two  address
     instruction) an Operand error is signalled.

	       ←←←←←←←←←←←←←←←←
     Push/Pop  |   F	   C  |
	       ----------------

     When  this mode is the first specifier it takes the operand  from
     the  top  of  the stack and then increments ("pops")  SP  by  the
     length of the operand.  So the instruction
		   ADDR	 STK,mem
     will  use	a 32 bit real value from the top of the stack  as  the
     first  operand,  pop  the stack and store the  result  at	"mem".
     Similarly a
		   MOVH	 STK,mem
     will  move the halfword on the top of the stack to "mem" and  pop
     the stack.	 When used as the second specifier, the second operand
     and the result come from the stack top.  Thus with arithmetic and
     logical instructions there is no change in SP.  However,
		   MOVR	   mem,STK
     will  decrement  SP by four (the length of the operand) and  move
     the real value at "mem" to the top of the stack.	When this mode
     is	 used in both specifiers then the classical  stack  operations
     result:  both operands are popped off the stack, the operation is
     performed	and the result is pushed back on the  stack.   In  the
     case  of Divide and Subtract the operand at the top of the	 stack
     is the dividend and subtrahend respectively.   If both specifiers
     are STK for a Move instruction, only the flags are affected.  STK
     may  not be used as the source of a MOVA or the  destination of a
     BRANCH instruction.










				  - 58 -





     4.8  INSTRUCTION DEFINITIONS

     4.8.1  Instruction Set Details

     In this section we give detailed information on each of the NCUBE
     processor's   instructions.     The   instructions	  are	listed
     alphabetically   (by  mnemonic)  and  are	grouped	 according  to
     operation (e.g. all the ADD instructions are grouped together).

     Before   listing	each  instruction  we  will   first   describe
     characteristics  that  are	 common to all of  them.   The	memory
     format of all of the instructions is shown below (the source  and
     destination specifiers are optional; while most instructions have
     two addresses there are a few with zero or one address).

	 ←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←
	 | OPCODE    REFERENCE 1 (src)	 REFERENCE 2 (dsrc, des)  |
	 ----------------------------------------------------------
	 ↑low address in memory

     The  source  (src)	 address is always  evaluated  first  and  all
     addressing	 operations (e.g.  autodecrement) are performed before
     the destination (dsrc,  des) address is evaluated.	 (In the above
     notation  "dsrc"  refers to the operand before the	 operation  is
     performed and "des" refers to the contents of that address	 after
     the  operation.)	This does not apply to stack addressing	 modes
     where the SP at the beginning of the instruction is always	 used.
     Any  addressing mode that refers to the PC (or SP) uses the value
     of	 the  PC (or SP) at the beginning  of  the  instruction.   The
     source  operand  is  never changed except when  using  the	 stack
     addressing	 mode.	 If  an	 instruction  with  byte  or  halfword
     operands  references a general register,  the high order part  of
     the  data is ignored if it is a source;  if it is a  destination,
     the high order part is set to the sign extension of the low order
     part.

     We will list the unique exception conditions for each instruction
     but  there	 are a set of exceptions that are independent  of  the
     particular instruction and they are listed here:
	  1) Memory error (ECC or Correctable ECC)
	  2) Timeout
	  3) Operand error (reserved addressing mode, literal or
	     immediate as the destination)
	  4) Address error (address value greater than 2**17-1)
	  5) Stack overflow













				  - 59 -





     The  result  stored  at  the  destination	of  a  floating	 point
     instruction is described below.   The result is stored before the
     exception	is  signalled by an interrupt (except for Zero	Divide
     and Invalid).
	  1) Inexact:  the correctly rounded result
	  2) Underflow:	 the correctly rounded fraction but with the
	     exponent increased by the bias
	  3) Zero Divide:  no result is stored; the destination is not
	     changed
	  4) Overflow:	the correctly rounded fraction but with the
	     exponent decreased by the bias
	  5) Invalid:  no result is stored; the destination is not
	     changed.

     Finally,  it  is important to remember that the Negative (N) Flag
     is always set according to the sign of the correct result.	  Thus
     on integer overflow the destination may appear positive even when
     N indicates negative.








































				  - 60 -





     4.8.2  Instruction Definitions



     ADC --- ADD WITH CARRY


     Opcodes:	    50	 ADCB	   ADd with Carry Byte
		    52	 ADCH	   ADd with Carry Halfword
		    54	 ADCW	   ADd with Carry Word

     Assembler
	Syntax:	    ADC{B,H,W}	src,des

     Operation:	    src + dsrc + Carry --> des

     Flags:	    C <-- carry from most significant bit
		    N <-- des < 0
		    Z <-- des = 0
		    V <-- Integer overflow
		    U <-- 0

     Description:   The Carry and source values are added to the
		    destination	   and	 the   result	replaces   the
		    destination.

     Exceptions:    Integer overflow































				  - 61 -







     ADCD --- ADD WITH CARRY DECIMAL


     Opcode:	    81	 ADCD	   ADd with Carry Decimal

     Assembler
	Syntax:	    ADCD  src,des

     Operation:	    src + dsrc + Carry --> des

     Flags:	    C <-- Carry out of high order digit
		    N <-- 0
		    Z <-- des = 0
		    V <-- 0
		    U <-- 0

     Description:   The Carry and source value (a byte treated as a
		    two digit decimal value) are added to the
		    destination (also considered as a two digit
		    decimal value) and the result replaces the
		    destination.  No check for invalid BCD encoding
		    is made.

     Exceptions:    none
































				  - 62 -






     ADD --- ADD


     Opcodes:	    40	 ADDB	   ADD Byte
		    42	 ADDH	   ADD Halfword
		    44	 ADDW	   ADD Word
		    48	 ADDR	   ADD Real
		    4A	 ADDL	   ADD Longreal

     Assembler
	Syntax:	    ADD{B,H,W,R,L}  src,des

     Operation:	    src + dsrc --> des

     Flags:  (Integer Operations:  ADDB,ADDH,ADDW)
		    C <-- carry from most significant bit
		    N <-- des < 0
		    Z <-- des = 0
		    V <-- Integer overflow
		    U <-- 0

     Flags:  (Floating Point Operations:  ADDR,ADDL)
		    C <-- des < 0
		    N <-- des < 0
		    Z <-- des = 0
		    V <-- 0
		    U <-- 0
		    IX <-- des rounded
		    UF <-- des underflowed
		    FZ <-- 0
		    OF <-- des overflowed
		    IN <-- dsrc or src = Nan

     Description:   The	 source is added to the destination  and  the
		    result   is	  stored   at  the  address   of   the
		    destination.

     Exceptions:    Integer overflow, Inexact, Underflow, Overflow,
		    Invalid


















				  - 63 -







     AND --- AND


     Opcodes:	    41	 ANDB	   AND Byte
		    43	 ANDH	   AND Halfword
		    45	 ANDW	   AND Word

     Assembler
	Syntax:	    AND{B,H,W}	   src,des

     Operation:	    src AND dsrc --> des

     Flags:	    C <-- C
		    N <-- des < 0
		    Z <-- des = 0
		    V <-- 0
		    U <-- 0

     Description:   The destination operand is anded with the  source
		    and	 the  result  is  stored  at  the  destination
		    address.

     Exceptions:    none

     See Also:	    BIT































				  - 64 -





     B -- BRANCH


     Opcodes:	    DF	 JMP   Unconditional	  JuMP unconditional
		    BF	 BV    V=1		  Branch on oVerflow
		    AF	 BNV   V=0		  Branch on Not
						  oVerflow
		    9F	 BE    Z=1		  Branch on Equal
		    8F	 BNE   Z=0		  Branch on Not Equal
		    0F	 BG   (N or Z)=0	  Branch on Greater
		    4F	 BGE   N=0		  Branch on Greater or
						  Equal
		    5F	 BL    N=1		  Branch on Less
		    1F	 BLE  (N or Z)=1	  Branch on Less or
						  Equal
		    2F	 BGU  (C or Z)=0 or U=1	  Branch on Greater
						  Unsigned
		    6F	 BGEU  C=0 or U=1	  Branch on Greater or
						  Equal Unsigned
		    7F	 BLU   C=1 or U=1	  Branch  on  Less
						  Unsigned
		    3F	 BLEU (C or Z)=1 or U=1	  Branch on Less  or
						  Equal Unsigned
     Assembler
	Syntax:	    JMP	 src
		    B{V,NV,E,NE,G,GE,L,LE,GU,GEU,LU,LEU}  src

     Operation:	    If Condition is True then
		      Literal Mode:  PC <-- PC + src
		      Register Direct Mode:  PC <-- PC + content (reg)
		      Other Modes:   PC <-- address of (src)

     Flags:	    No flags are changed except IN (INvalid
		    exception).	 IN is set only when U=1 on
		    BG, BGE, BL, BLE.  The Repeat Mode (REP) is
		    reset (REP <-- 00) after decrementing the
		    counter and checking the condition (see below).

     Description:   The	 Branch	 instructions  are  relative  in  the
		    literal and register direct modes and use the
		    value of the PC at the beginning of the
		    instruction.  In all other modes the address of
		    the source operand replaces the PC.	 The Invalid
		    exception results when comparison accesses at
		    least one Nan and a signed branch is performed on
		    the result.	 The unsigned branches should be used
		    for the predicates defined in the IEEE Floating
		    Point Standard that must not fault.	 The Repeat
		    Mode is reset after decrementing the counter and
		    testing the termination condition so that if a
		    REPeat instruction preceeds a branch they act
		    together like a "loop" instruction.

     Exceptions:    Invalid (BG,BGE,BL,BLE when U = 1); Illegal
		    Address (immediate mode, stack mode)



				  - 65 -







     BCNT --- BROADCAST COUNT


     Opcode:	    C5	 BCNT	   Broadcast CouNT

     Assembler
	Syntax:	    BCNT src,des

     Operation:	    src --> des MASK (All Output Count Register #'s)

     Flags:	    no changes

     Description:   The Output Count registers whose numbers
		    correspond to bit positions in des that are
		    set to one are loaded with the src value.  The
		    Output Count registers are numbered
		    32,33,...,41,63 so the bit positions in des are
		    understood to be offset by 32.  Both src and des
		    are Word values.

     Exceptions:    none

     See Also:	    BPTR

































				  - 66 -








     BIT --- BIT TEST


     Opcodes	    C0	 BITB	   BIT test Byte
		    C2	 BITH	   BIT test Halfword
		    C4	 BITW	   BIT test Word

     Assembler
	Syntax:	    BIT{B,H,W}	src,dsrc

     Operation:	    src AND dsrc

     Flags:	    C <-- C
		    N <-- (src AND dsrc) < 0
		    Z <-- (src AND dsrc) = 0
		    V <-- 0
		    U <-- 0

     Description:   The	 Z Flag is set to 0 if all the bits of src
		    are 0 that correspond to mask (dsrc) bits that
		    are 1.  Neither src nor dsrc is changed.

     Exceptions:    none

     See Also:	    AND, CMP






























				  - 67 -







     BKPT --- BREAKPOINT


     Opcode:	    6B	 BKPT	   BreaKPoinT

     Assembler
	Syntax:	    BKPT

     Operation:	    generate interrupt 2:
		      stack <-- PS
		      stack <-- PC
		      PC <-- Word at location 16
		      PS <-- Word at location 20

     Flags:	    all flags set according to the new PS

     Description:   This one byte instruction is used by a debugger
		    to set breakpoints in a user's program.

     Exceptions:    none


     See Also:	    TRAP, RETI

































				  - 68 -








     BPTR --- BROADCAST POINTER


     Opcode:	    D5	 BPTR	   Broadcast PoinTeR

     Assembler
	Syntax:	    BPTR  src,des

     Operation:	    src --> des MASK (All Output Register #'s)

     Flags:	    no changes

     Description:   The Output Registers whose numbers correspond
		    with the bit positions in des that are set are
		    loaded with the src.  This instruction sets up a
		    group of Output Pointer registers to address a
		    memory area containing a message to be broadcast.
		    The Pointer registers should be set up before the
		    Count registers (BCNT) are loaded.	Both src and
		    des are Word values.

     Exceptions:    none

     See Also:	    BCNT































				  - 69 -





     CALL --- CALL


     Opcode:	    CF	 CALL	   CALL

     Assembler
	Syntax:	    CALL src

     Operation:	    Literal:  stack <-- PC
			      PC <-- PC + src
		    Register Direct Mode:  stack <-- PC
					   PC <-- PC + content (reg)
		    Other Modes:   stack <-- PC
				   PC <-- address of (src)

     Flags:	    no changes except REP <-- 00 (see below)

     Description:   The current value of the Program Counter (PC) is
		    pushed on the stack and by loading the PC with a
		    new value a branch to a subroutine is taken.  If
		    the CALL is preceded by a REPEAT instruction the
		    counter is decremented and the termination
		    condition is checked.  The Repeat Mode is reset
		    (REP <-- 00) and if termination is not reached
		    then the return address that is pushed on the
		    stack points to the REPEAT instruction.  If
		    termination is reached the CALL instruction is
		    skipped.  This enables the processor to execute
		    multiple CALLs.  If there is no preceding REPEAT
		    then the saved return address points to the
		    beginning of the instruction following the CALL.
		    If the addressing mode is Literal or Register
		    Direct the call is relative and uses the value
		    of PC at the beginning of the CALL instruction.

     Exceptions:    Illegal Address (immediate mode, stack mode)

     See Also:	    RET, RETP




















				  - 70 -







     CLC -- CLEAR CARRY


     Opcode:	    1B	 CLC	   CLear Carry

     Assembler
	Syntax:	    CLC

     Operation:	    C <-- 0

     Flags:	    C <-- 0
		    no other changes

     Description:   The Carry Flag is set to zero.

     Exceptions:    none

     See Also:	    CMC, STC






































				  - 71 -







     CMC -- COMPLEMENT CARRY


     Opcode:	    3B	 CMC	   CoMplement Carry

     Assembler
	Syntax:	    CMC

     Operation:	    C <-- not(C)

     Flags:	    C <-- not(C)
		    no other changes

     Description:   The Carry Flag is reversed.

     Exceptions:    none

     See Also:	    CLC, STC






































				  - 72 -






     CMP --- COMPARE


     Opcodes:	    30	 CMPB	   CoMPare Byte
		    32	 CMPH	   CoMPare Halfword
		    34	 CMPW	   CoMPare Word
		    38	 CMPR	   CoMPare Real
		    3A	 CMPL	   CoMPare Longreal

     Assembler
	Syntax:	    CMP{B,H,W,R,L}  src,dsrc

     Operation:	    src - dsrc --> tem

     Flags:  (Integer Operations:  CMPB,CMPH,CMPW)
		    C <-- src < (unsigned) dsrc
		    N <-- tem < 0
		    Z <-- tem = 0
		    V <-- 0
		    U <-- 0

     Flags:  (Floating Point Operations:  CMPR,CMPL)
		    C <-- tem < 0
		    N <-- tem < 0
		    Z <-- tem = 0
		    V <-- 0
		    U <-- src or dsrc = Nan
		    IX <-- 0
		    UF <-- 0
		    FZ <-- 0
		    OF <-- 0
		    IN <-- 0

     Description:   The value src is compared to dsrc and the
		    appropriate flags are set for subsequent
		    conditional branching.  Neither src nor dsrc
		    is changed.	 The Carry flag is set by the
		    Floating Point comparisons so that the Unsigned
		    branches can be used for the Unordered
		    predicates defined in the IEEE Floating Point
		    Standard.  Also if either src or dsrc is Nan the
		    appropriate Invalid exception is signalled by the
		    branch instruction.


     Exceptions:    none

     See Also:	    BIT









				  - 73 -






     CV -- CONVERT


     Opcodes:	    09	 CVBR	   ConVert Byte to Real
		    19	 CVHR	   ConVert Halfword to Real
		    39	 CVLR	   ConVert Longreal to Real
		    49	 CVBL	   ConVert Byte to Longreal
		    59	 CVHL	   ConVert Halfword to Longreal
		    69	 CVWL	   ConVert Word to Longreal
		    79	 CVRL	   ConVert Real to Longreal
		    89	 CVBW	   ConVert Byte to Word
		    99	 CVHW	   ConVert Halfword to Word
		    A9	 CVWB	   ConVert Word to Byte
		    B9	 CVWH	   ConVert Word to Halfword

     Assembler
	Syntax:		 CV{BR,HR,LR,BL,HL,WL,RL,
				      BW,HW,WB,WH}  src,des

     Operation:	    CONVERT (src) --> des

     Flags:  (All Operations)
		    C <-- C	   (when des is INTEGER)
		    C <-- des < 0  (when des is FLOATING POINT)
		    N <-- des < 0
		    Z <-- des = 0
		    V <-- Integer overflow (when des is INTEGER)
		    V <-- 0	    (when des is FLOATING POINT)
		    U <-- 0
		    IX <-- des rounded
		    UF <-- des underflowed
		    FZ <-- 0
		    OF <-- des overflowed
		    IN <-- src = Nan

     Description:   The source operand is converted to the type
		    and length indicated by the destination
		    specifier and stored at the address of the
		    destination.

     Exceptions:    Integer overflow [CVWB,CVWH]
		    Inexact [CVLR], Invalid [CVRL,CVLR]
		    Overflow [CVLR], Underflow [CVLR]














				  - 74 -






     DI --- DISABLE INTERRUPTS


     Opcode:	    9B	 DI	   Disable Interrupts

     Assembler
	Syntax:	    DI

     Operation:	    0 --> IE (flag in Program Status register)

     Flags:	    IE <-- 0
		    no other changes

     Description:   The Interrupt Enable (IE) flag in the Program
		    Status register is set to zero.  This disables
		    all interrupts that can be disabled.

     Exceptions:    none

     See Also:	    EI





































				  - 75 -





     DIV --- DIVIDE


     Opcodes:	    B0	 DIVB	   DIVide Byte
		    B2	 DIVH	   DIVide Halfword
		    B4	 DIVW	   DIVide Word
		    B8	 DIVR	   DIVide Real
		    BA	 DIVL	   DIVide Longreal

     Assembler
	Syntax:	    DIV{B,H,W,R,L}  src,des

     Operation:	    dsrc / src --> des

     Flags:  (Integer Operations:  DIVB,DIVH,DIVW)
		    C <-- C
		    N <-- des < 0
		    Z <-- des = 0
		    V <-- Integer overflow
		    U <-- 0
     Flags:  (Floating Point Operations:  DIVR,DIVL)
		    C <-- des < 0
		    N <-- des < 0
		    Z <-- des = 0
		    V <-- 0
		    U <-- 0
		    IX <-- des rounded
		    UF <-- des underflowed
		    FZ <-- (src = 0 and des <> 0)
		    OF <-- des overflowed
		    IN <-- (src or dsrc = Nan) or (src and dsrc = 0)

     Description:   The destination is divided by the source and the
		    result is stored at the destination address.

     Exceptions:    Integer overflow (dsrc = largest negative value,
		    src = -1), Integer Zero Divide, Inexact,
		    Underflow, Floating Zero Divide, Overflow,
		    Invalid

     See Also:	    DVR

















				  - 76 -






     DVR --- DIVIDE REVERSE


     Opcodes:	    90	 DVRB	   DiVide Reverse Byte
		    92	 DVRH	   DiVide Reverse Halfword
		    94	 DVRW	   DiVide Reverse Word
		    98	 DVRR	   DiVide Reverse Real
		    9A	 DVRL	   DiVide Reverse Longreal

     Assembler
	Syntax:	    DVR{B,H,W,R,L}  src,des

     Operation:	    src / dsrc --> des

     Flags:  (Integer Operations:  DVRB,DVRH,DVRW)
		    C <-- C
		    N <-- des < 0
		    Z <-- des = 0
		    V <-- Integer overflow
		    U <-- 0

     Flags:  (Floating Point Operations:  DVRR,DVRL)
		    C <-- des < 0
		    N <-- des < 0
		    Z <-- des = 0
		    V <-- 0
		    U <-- 0
		    IX <-- des rounded
		    UF <-- des underflowed
		    FZ <-- (des = 0 and src <> 0)
		    OF <-- des overflowed
		    IN <-- (src or dsrc = Nan) or (src and dsrc = 0)

     Description:   The source operand is divided by the destination
		    operand and the result is stored at the address
		    of the destination.

     Exceptions:    Integer overflow (src = largest negative value,
		    dsrc = -1), Integer Zero Divide, Inexact,
		    Underflow, Floating Zero Divide, Overflow,
		    Invalid

     See Also:	    DIV














				  - 77 -







     EI --- ENABLE INTERRUPTS


     Opcode:	    8B	 EI	   Enable Interrupts

     Assembler
	Syntax:	    EI

     Operation:	    1 --> IE (Interrupt Enable flag in Program Status
			      register)

     Flags:	    IE <-- 1
		    no other changes

     Description:   The Interrupt Enable (IE) flag in the Program
		    Status register is set to one.  This enables all
		    interrupts that have not been otherwise disabled.

     Exceptions:    none

     See Also:	    DI



































				  - 78 -





     ER --- ERROR


     Opcodes:	    4B	 ERON	   ERror ON
		    5B	 EROF	   ERror OFf

     Assembler
	Syntax:	    ER{ON,OF}

     Operation:	    ERROR pin <-- 1 (ERON)
		    ERROR pin <-- 0 (EROF)

     Flags:	    no changes

     Description:   Error on and off are used to set a pin level
		    in order to indicate a potentially fatal
		    condition (see 4.5).

     Exceptions:    none







































				  - 79 -





     FFO --- FIND FIRST ONE


     Opcodes:	    31	 FFOB	   Find First One Byte
		    33	 FFOH	   Find First One Halfword
		    35	 FFOW	   Find First One Word

     Assembler
	Syntax:	    FFO{B,H,W}	src,des

     Operation:	    location of first one (src) --> des

     Flags:	    C <-- C
		    N <-- 0
		    Z <-- src = 0
		    V <-- 0
		    U <-- 0

     Description:   If the source is zero the destination is set to
		    8 (FFOB), 16 (FFOH) or 32 (FFOW) and the Z Flag
		    is set to one.  Otherwise, Z is zero and the
		    destination is set to the bit position of the
		    first one bit in the source, scanning from the
		    right (e.g. if the least significant bit is one
		    the destination is set to zero).  The destination
		    is a Byte even though the source can be a Byte
		    (FFOB), Halfword (FFOH) or Word (FFOW).

     Exceptions:    none





























				  - 80 -






     LCNT --- LOAD COUNT


     Opcode:	    A5	 LCNT	   Load CouNT

     Assembler
	Syntax:	    LCNT  src,des

     Operation:	    src --> I/O Count Register #(des)

     Flags:	    no changes

     Description:   The I/O Count Register designated by the
		    destination is loaded with the source operand.
		    The Input Registers are numbered 0,1,...,9,31 and
		    the Output Registers are 32,33,...,41,63.  The
		    least significant bit of the Count Register is
		    always zero but no error is signalled if an
		    attempt is made to load an odd number.  Also no
		    error is signalled if des is not one of the
		    register numbers defined above but the result is
		    undefined.	The source operand is a Word and the
		    destination is a Byte.

     Exceptions:    none

     See Also:	    LPTR






























				  - 81 -






     LDPR --- LOAD PROCESSOR REGISTERS


     Opcode:	    85	 LDPR	   LoaD Processor Register

     Assembler
	Syntax:	    LDPR  src,des

     Operation:	    src --> Processor Register #(des)

     Flags:	    no changes

     Description:   The source value is loaded into the Processor
		    Register designated by the destination.  The
		    Processor Registers are listed below.  No
		    operation is performed if a "read only" register
		    is designated by des.  The source is a Word and
		    the destination operand is a Byte value
		    indicating one of the Processor Registers.

		    P0	SP  Stack Pointer
		    P1	PS  Program Status
		    P2	FR  Fault Register	   (read only)
		    P3	CR  Configuration Register (b24-b31 read only)
		    P4	PI  Processor I. D.
		    P5	TR  Timeout Register
		    P6	OR  Output Ready	   (read only)
		    P7	IR  Input Ready		   (read only)
		    P8	OE  Output Enable
		    P9	IE  Input Enable
		    P10 IP  Input Pending	   (read only)
		    P11 PE  Parity Error	   (read only)
		    P12 IO  Input Overrun	   (read only)

     Exceptions:    none

     See Also:	    STPR




















				  - 82 -






     LPTR --- LOAD POINTER

     Opcode:	    B5	 LPTR	   Load PoinTeR

     Assembler
	Syntax:	    LPTR  src,des

     Operation:	    src --> I/O Address Register #(des)

     Flags:	    no changes

     Description:   The I/O Address Register designated by the
		    destination is loaded with the source operand.
		    The Input Registers are numbered 0,1,...,9,31 and
		    the Output Registers are 32,33,...,41,63.  The
		    least significant bit of the Address Register is
		    always zero but no error is signalled if an
		    attempt is made to load an odd address.  Also no
		    error is signalled if des is not one of the
		    register numbers defined above but the result is
		    undefined.	The source operand is a Word and the
		    destination is a Byte.

     Exceptions:    none

     See Also:	    LCNT































				  - 83 -







     MOV --- MOVE


     Opcodes:	    00	 MOVB	   MOVe Byte
		    02	 MOVH	   MOVe Halfword
		    04	 MOVW	   MOVe Word
		    08	 MOVR	   MOVe Real
		    0A	 MOVL	   MOVe Longreal

     Assembler
	Syntax:	    MOV{B,H,W,R,L}  src,des

     Operation:	    src --> des

     Flags:	    no changes

     Description:   The source value is moved to the destination
		    address.  The Fault Register is set by the
		    MOVR and MOVL instructions.

     Exceptions:    none



































				  - 84 -






     MOVA --- MOVE ADDRESS


     Opcode:	    E5	 MOVA	   MOVe Address

     Assembler
	Syntax:	    MOVA  src,des

     Operation:	    Literal Mode:  src + PC --> des
		    Register Direct Mode:  content (reg) + PC --> des
		    Stack Mode:	 content (SP) --> des
		    Other Modes:  address of (src) --> des

     Flags:	    no changes

     Description:   The address specifier of the source operand is
		    evaluated and stored at the destination
		    location.  If the addressing mode of the source
		    is Literal or Register Direct the PC is first
		    added to the source value.	The value of PC used
		    is that at the beginning of the instruction.  If
		    the source addressing mode is Stack mode then the
		    contents of the Stack Pointer are moved to the
		    destination.  If the source is Immediate or Stack
		    an illegal address fault is generated.

     Exceptions:    Illegal Address






























				  - 85 -






     MUL --- MULTIPLY


     Opcodes:	    80	 MULB	   MULtiply Byte
		    82	 MULH	   MULtiply Halfword
		    84	 MULW	   MULtiply Word
		    88	 MULR	   MULtiply Real
		    8A	 MULL	   MULtiply Longreal

     Assembler
	Syntax:	    MUL{B,H,W,R,L}  src,des

     Operation:	    src * dsrc --> des

     Flags:  (Integer Operations:  MULB,MULH,MULW)
		    C <-- C
		    N <-- des < 0
		    Z <-- des = 0
		    V <-- Integer overflow
		    U <-- 0

     Flags:  (Floating Point Operations:  MULR,MULL)
		    C <-- des < 0
		    N <-- des < 0
		    Z <-- des = 0
		    V <-- 0
		    U <-- 0
		    IX <-- des rounded
		    UF <-- des underflowed
		    FZ <-- 0
		    OF <-- des overflowed
		    IN <-- dsrc or src = Nan

     Description:   The source and destination are multiplied and
		    the result is stored at the address of the
		    destination.  Integer overflow occurs when the
		    high order half of the product is not the sign
		    extension of the low order half.  This is true
		    even when the operands are bytes or halfwords in
		    registers.

     Exceptions:    Integer overflow, Inexact, Underflow, Overflow,
		    Invalid














				  - 86 -






     NEG --- NEGATE


     Opcodes:	    10	 NEGB	   NEGate Byte
		    12	 NEGH	   NEGate Halfword
		    14	 NEGW	   NEGate Word
		    18	 NEGR	   NEGate Real
		    1A	 NEGL	   NEGate Longreal

     Assembler
	Syntax:	    NEG{B,H,W,R,L}  src,des

     Operation:	    -(src) --> des

     Flags:  (Integer Operations:  NEGB,NEGH,NEGW)
		    C <-- borrow from most significant bit
		    N <-- des < 0
		    Z <-- des = 0
		    V <-- Integer overflow
		    U <-- 0

     Flags:  (Floating Point Operations:  NEGR,NEGL)
		    C <-- des < 0
		    N <-- des < 0
		    Z <-- des = 0
		    V <-- 0
		    U <-- 0
		    IX <-- 0
		    UF <-- 0
		    FZ <-- 0
		    OF <-- 0
		    IN <-- 0

     Description:   The source operand is negated and the result is
		    stored at the address of the destination.
		    Integer overflow occurs when the source is the
		    largest negative number.  There are no floating
		    point exceptions; the source is simply copied
		    with the sign bit reversed.	 Thus, the floating
		    point operation is not strictly equivalent to a
		    subtract from zero.


     Exceptions:    Integer overflow













				  - 87 -






     NOP --- NO OPERATION


     Opcode:	    0B	 NOP	   NO oPeration

     Assembler
	Syntax:	    NOP

     Operation:	    nothing

     Flags:	    no changes

     Description:   This instruction does nothing.

     Exceptions:    none










































				  - 88 -






     NOT --- NOT


     Opcodes:	    71	 NOTB	   NOT Byte
		    73	 NOTH	   NOT Halfword
		    75	 NOTW	   NOT Word

     Assembler
	Syntax:	    NOT{B,H,W}	src,des

     Operation:	    NOT(src) --> des

     Flags:	    C <-- C
		    N <-- des < 0
		    Z <-- des = 0
		    V <-- 0
		    U <-- 0

     Descripion:    The source operand is complemented and the result
		    is stored at the destination location.

     Exceptions:    none



































				  - 89 -






     OR --- OR


     Opcodes:	    51	 ORB	   OR Byte
		    53	 ORH	   OR Halfword
		    55	 ORW	   OR Word

     Assembler
	Syntax:	    OR{B,H,W}  src,des

     Operation:	    src OR dsrc --> des

     Flags:	    C <-- C
		    N <-- des < 0
		    Z <-- des = 0
		    V <-- 0
		    U <-- 0

     Description:   The destination and source are "ored" together
		    and the result is stored at the address of the
		    destination.

     Exceptions:    none


































				  - 90 -






     REM --- REMAINDER


     Opcodes:	    A0	 REMB	   REMainder Byte
		    A2	 REMH	   REMainder Halfword
		    A4	 REMW	   REMainder Word
		    A8	 REMR	   REMainder Real
		    AA	 REML	   REMainder Longreal

     Assembler
	Syntax:	    REM{B,H,W,R,L}  src,des

     Operation:	    dsrc REM src --> des

     Flags:  (Integer Operations:  REMB,REMH,REMW)
		    C <-- C
		    N <-- des < 0
		    Z <-- des = 0
		    V <-- 0
		    U <-- 0

     Flags:  (Floating Point Operations:  REMR,REML)
		    C <-- des < 0
		    N <-- des < 0
		    Z <-- abs(des) < abs(src)
		    V <-- 0
		    U <-- 0
		    IX <-- 0
		    UF <-- des underflowed
		    FZ <-- 0
		    OF <-- 0
		    IN <-- (dsrc or src = Nan) or (src = 0)

     Description:   The remainder of the destination divided by the
		    source replaces the destination.  The sign of
		    the result is the sign of "dsrc".  The floating
		    point instruction is used for argument
		    reduction and is always exact.  However, it
		    is only a partial remainder; the instruction
		    must be repeated until Z becomes one (that is
		    the reason for the unusual definition of the Z
		    flag).

     Exceptions:    Integer Zero Divide, Underflow, Invalid













				  - 91 -






     REP --- REPEAT


     Opcodes:	    1E	 REP	   REPeat while count not zero
		    2E	 REPZ	   REPeat while Zero flag set
		    3E	 REPNZ	   REPeat while zero flag Not set

     Assembler
	Syntax:	    REP{ ,Z,NZ}	 src

     Operation:	    REP:   PS(31,30) <-- 01; Count = REG#(src)
		    REPZ:  PS(31,30) <-- 10; Count = REG#(src); Z = 1
		    REPNZ: PS(31,30) <-- 11; Count = REG#(src); Z = 0
			for all: PS(29,28,27,26) <-- src
			   after repeat condition satisfied (on REPZ
			   and REPNZ the Z flag is checked before the
			   Count)
			   PS(31,30) <-- 00

     Flags:	    no changes except as specified above

     Description:   A REPeat instruction may precede any other
		    instruction.  It causes bits 26 to 31 in the
		    Program Status register to be set as shown above.
		    The instruction following the repeat is re-
		    executed and the count register (a general
		    register indicated by src) is decremented
		    until the repeat condition is satisfied.  One of
		    the conditions for all three instructions is that
		    the count register become zero.  But if the Z flag
		    becomes zero (REPZ) or one (REPNZ) then the
		    condition is also satisfied and the repeat is
		    terminated by setting bits 30 and 31 in the PS
		    register to 0.  The Z flag is checked (for REPZ
		    and REPNZ) before the Count is decremented
		    so that it will correctly count the number of
		    times the following instruction is executed.  If
		    the Count is initially zero the following
		    instruction is skipped.  If a repeat is used with
		    a branch instruction it has the effect of a "loop"
		    instruction.  If an addressing mode other than
		    register direct is used, an address error is
		    signalled.	If the designated Count register is
		    used in the following instruction in an addressing
		    mode or as an operand the results are undefined.
		    And, because of the instruction pipeline, REPZ and
		    REPNZ must not precede a floating point operation
		    or a MUL, DIV, DVR or REM instruction.  (REP can
		    be used anywhere.)








				  - 92 -





		    As examples of the use of Repeat assume that R4
		    and R5 point to two vectors of real numbers, that
		    R15 contains the length of the vectors and that
		    R10 is zero.  Then

			      REP   R15
			      ADDR  (R4)+,R10

		    will accumulate in R10 the summation of the vector
		    elements pointed to by R4 and

			 L:   MOVR  (R4)+,R9
			      MULR  (R5)+,R9
			      ADDR  R9,R10
			      REP   R15
			      JMP   L

		    will compute the inner product of the two vectors.

     Exceptions:    Illegal Address






































				  - 93 -






     RET --- RETURN


     Opcode:	    EB	 RET	   RETurn

     Assembler
	Syntax:	    RET

     Operation:	    PC <-- stack

     Flags:	    no changes (the Repeat Mode is set to zero)

     Description:   The contents of the stack top (assumed to be a
		    return address) are popped into the Program
		    Counter.

     Exceptions:    none

     See Also:	    CALL, RETP






































				  - 94 -






     RETI --- RETURN FROM INTERRUPT


     Opcode:	    CB	 RETI	   RETurn from Interrupt

     Assembler
	Syntax:	    RETI

     Operation:	    PC <-- stack
		    PS <-- stack

     Flags:	    All flags set according to the new PS

     Description:   The top of stack (assumed to contain the PC in
		    effect before the current interrupt) is popped
		    into the PC register and then the next value on
		    the stack is popped into the Program Status (PS)
		    register.

     Exceptions:    none

     See Also:	    BKPT,RETT,TRAP



































				  - 95 -






     RETP --- RETURN AND POP


     Opcode:	    EF	 RETP	   RETurn and Pop

     Assembler
	Syntax:	    RETP  src

     Operation:	    PC <-- stack
		    SP <-- SP + src

     Flags:	    no changes (the Repeat Mode is set to zero)

     Description:   The top of stack is popped into the Program
		    Counter and then the source (Word) value is added
		    to the Stack Pointer in order to pop a set of
		    local variables or pointers off the stack.

     Exceptions:    none

     See Also:	    CALL, RET




































				  - 96 -






     RETT --- RETURN FROM TRACE


     Opcode:	    DB	 RETT	   RETurn from Trace

     Assembler
	Syntax:	    RETT

     Operation:	    PC <-- stack
		    PS <-- stack

     Flags:	    All flags set according to the new PS

     Description:   The top of stack (assumed to contain the PC in
		    effect before the current interrupt) is popped
		    into the PC register and then the next value on
		    the stack is popped into the Program Status (PS)
		    register.  Interrupts are inhibited until the
		    next instruction is completed.

     Exceptions:    none

     See Also:	    RETI


































				  - 97 -






     ROT --- ROTATE


     Opcodes:	    21	 ROTB	   ROTate Byte
		    23	 ROTH	   ROTate Halfword
		    25	 ROTW	   ROTate Word

     Assembler
	Syntax:	    ROT{B,H,W}	src,des

     Operation:	    dsrc ROTATE BY src --> des

     Flags:	    C <-- if src = 0 then the least significant bit
			  of des, otherwise the last bit shifted out
		    N <-- des < 0
		    Z <-- des = 0
		    V <-- 0
		    U <-- 0

     Description:   If the source is zero the destination is not
		    changed but the Carry flag is set to the least
		    significant bit of dsrc.  Otherwise dsrc is
		    rotated (left if src < 0; right if src > 0) and
		    the Carry flag is set to the value of the last
		    bit shifted out.  The source is always a Byte
		    operand even though the destination can be a
		    Byte (ROTB), Halfword (ROTH) or Word (ROTW).

     Exceptions:    none




























				  - 98 -






     RSET --- RESET


     Opcode:	    7B	 RSET	   ReSET processor

     Assembler
	Syntax:	    RSET

     Operation:	    The processor is initialized

     Flags:	    no changes

     Description:   RSET causes the Integer and Floating Point
		    Execution units to be initialized and all pending
		    interrupts to be reset.  All I/O activity is
		    aborted.  The serial channel "ready" flags are set
		    to one (ready) and all other I/O registers are
		    cleared including error flags.

     Exceptions:    none





































				  - 99 -






     SBB --- SUBTRACT WITH BORROW


     Opcodes:	    70	 SBBB	   SuBtract with Borrow Byte
		    72	 SBBH	   SuBtract with Borrow Halfword
		    74	 SBBW	   SuBtract with Borrow Word

     Assembler
	Syntax:	    SBB{B,H,W}	src,des

     Operation:	    dsrc - src - Carry --> des

     Flags:	    C <-- borrow from most significant bit
		    N <-- des < 0
		    Z <-- des = 0
		    V <-- Integer overflow
		    U <-- 0

     Description:   The Carry (borrow) and source values are
		    subtracted from the destination and the result
		    replaces the destination.

     Exceptions:    Integer overflow


































				  - 100 -






     SBBD --- SUBTRACT DECIMAL


     Opcode:	    91	 SBBD	   SuBtract with Borrow Decimal

     Assembler
	Syntax:	    SBBD  src,des

     Operation:	    dsrc - src - Carry --> des

     Flags:	    C <-- borrow from most significant digit
		    N <-- 0
		    Z <-- des = 0
		    V <-- 0
		    U <-- 0

     Description:   The Carry value (borrow) and source (Byte) value
		    treated as a two digit BCD value are subtracted
		    from the destination considered similarly.	The
		    result replaces the destination.  The operands
		    are not checked for invalid BCD format.

     Exceptions:    none


































				  - 101 -






     SBR --- SUBTRACT REVERSE


     Opcodes:	    20	 SBRB	   SuBtract Reverse Byte
		    22	 SBRH	   SuBtract Reverse Halfword
		    24	 SBRW	   SuBtract Reverse Word
		    28	 SBRR	   SuBtract Reverse Real
		    2A	 SBRL	   SuBtract Reverse Longreal

     Assembler
	Syntax:	    SBR{B,H,W,R,L}  src,des

     Operation:	    src - dsrc --> des

     Flags:  (Integer Operations:  SBRB,SBRH,SBRW)
		    C <-- borrow from most significant bit
		    N <-- des < 0
		    Z <-- des = 0
		    V <-- Integer overflow
		    U <-- 0

     Flags:  (Floating Point Operations:  SBRR,SBRL)
		    C <-- des < 0
		    N <-- des < 0
		    Z <-- des = 0
		    V <-- 0
		    U <-- 0
		    IX <-- des rounded
		    UF <-- des underflowed
		    FZ <-- 0
		    OF <-- des overflowed
		    IN <-- src or dsrc = Nan

     Description:   The destination value is subtracted from the
		    source and the result replaces the destination.

     Exceptions:    Integer overflow, Inexact, Underflow, Overflow,
		    Invalid

     See Also:	    SUB

















				  - 102 -







     SFA --- SHIFT ARITHMETIC


     Opcodes:	    11	 SFAB	   ShiFt Arithmetic Byte
		    13	 SFAH	   ShiFt Arithmetic Halfword
		    15	 SFAW	   ShiFt Arithmetic Word

     Assembler
	Syntax:	    SFA{B,H,W}	src,des

     Operation:	    dsrc SHIFT ARITHMETIC BY src --> des

     Flags:	    C <-- if src = 0 then least significant bit (dsrc)
			       otherwise last bit shifted out
		    N <-- des < 0
		    Z <-- des = 0
		    V <-- Integer overflow
		    U <-- 0

     Description:   If the source is zero the destination is unchanged
		    and the Carry flag is set to the least significant
		    bit of the destination.  Otherwise, the operand
		    at the destination address is shifted by the
		    number of places equal to the value of the
		    source.  If the source is positive the shift is
		    to the left and if negative it is to the right.
		    Left shifts cause zero to be shifted in from the
		    right and right shifts cause the sign to be copied
		    from the left.  In	both cases the Carry flag
		    is set to the last bit shifted out.	 If the
		    shift is right Integer overflow cannot occur
		    but left shifts cause Integer overflow if the
		    bits shifted out are not all equal to the
		    resulting sign bit.	 The source operand is always
		    a Byte operand even though the destination can be
		    a Byte (SFAB), Halfword (SFAH) or Word (SFAW).

     Exceptions:    Integer overflow

     See Also:	    SFT
















				  - 103 -







     SFT --- SHIFT LOGICAL


     Opcodes:	    01	 SFTB	   ShiFT logical Byte
		    03	 SFTH	   ShiFT logical Halfword
		    05	 SFTW	   ShiFT logical Word

     Assembler
	Syntax:	    SFT{B,H,W}	src,des

     Operation:	    dsrc SHIFT LOGICAL BY src --> des

     Flags:	    C <-- if src = 0 then least significant bit (dsrc)
			       otherwise last bit shifted out
		    N <-- des < 0
		    Z <-- des = 0
		    V <-- 0
		    U <-- 0

     Description:   If the source is zero the destination is unchanged
		    and the Carry flag is set to the least significant
		    bit of the destination.  Otherwise, the operand
		    at the destination address is shifted by the
		    number of places equal to the value of the
		    source.  If the source is positive the shift is
		    to the left and if negative it is to the right.
		    Left shifts cause zero to be shifted in from the
		    right and right shifts cause zero to be shifted
		    in from the left.  In  both cases the Carry flag
		    is set to the last bit shifted out.	 The source
		    operand is always a Byte operand even though the
		    destination can be a Byte (SFTB), Halfword (SFTH)
		    or Word (SFTW).

     Exceptions:    none

     See Also:	    SFA



















				  - 104 -







     SGN --- SET SIGN


     Opcodes:	    78	 SGNR	   Set siGN Real
		    7A	 SGNL	   Set siGN Longreal

     Assembler
	Syntax:	    SGN{R,L}  src,des

     Operation:	    SIGN (src) --> SIGN (des)

     Flags:	    C <-- des < 0
		    N <-- des < 0
		    Z <-- des = 0
		    V <-- 0
		    U <-- 0
		    IX <-- 0
		    UF <-- 0
		    FZ <-- 0
		    OF <-- 0
		    IN <-- 0

     Description:   The sign of the destination is set to the sign
		    of the source.

     Exceptions:    None






























				  - 105 -






     SQT --- SQUARE ROOT


     Opcodes:	    58	 SQTR	   SQuare rooT Real
		    5A	 SQTL	   SQuare rooT Longreal

     Assembler
	Syntax:	    SQT{R,L}  src,des

     Operation:	    SQUARE ROOT (src) --> des

     Flags:	    C <-- 0
		    N <-- 0
		    Z <-- des = 0
		    V <-- 0
		    U <-- 0
		    IX <-- des rounded
		    UF <-- 0
		    FZ <-- 0
		    OF <-- 0
		    IN <-- (src < 0) or (src = Nan)

     Description:   The square root of the source replaces the
		    destination.  The square root is correctly
		    rounded and cannot overflow or underflow.

     Exceptions:    Inexact, Invalid






























				  - 106 -






     STC --- SET CARRY

     Opcode:	    2B	 STC	   SeT Carry

     Assembler
	Syntax:	    STC

     Operation:	    1 --> Carry

     Flags:	    C <-- 1
		    no other changes

     Description:   The Carry flag is set to one.

     Exceptions:    none

     See Also:	    CLC, CMC








































				  - 107 -






     STPR --- STORE PROCESSOR REGISTERS


     Opcode:	    95	 STPR	   STore Processor Registers

     Assembler
	Syntax:	    STPR  src,des

     Operation:	    PROCESSOR REGISTER # (src) --> des

     Flags:	    C <-- C
		    N <-- des < 0
		    Z <-- des = 0
		    V <-- 0
		    U <-- 0

     Description:   The contents of the Processor Register whose
		    number corresponds with the value of the source
		    replaces the destination.  The destination is a
		    Word and the source is a Byte value designating
		    a Processor Register.  The Processor Registers
		    are listed below.

			      P0  SP  Stack Pointer
			      P1  PS  Program Status
			      P2  FR  Fault Register	(read only)
			      P3  CR  Configuration Register
			      P4  PI  Processor I. D.
			      P5  TR  Timeout Register
			      P6  OR  Output Ready	(read only)
			      P7  IR  Input Ready	(read only)
			      P8  OE  Output Enable
			      P9  IE  Input Enable
			      P10 IP  Input Pending	(read only)
			      P11 PE  Parity Error	(read only)
			      P12 IO  Input Overrun	(read only)


     Exception:	    none

     See Also:	    LDPR
















				  - 108 -






     SUB --- SUBTRACT


     Opcodes:	    60	 SUBB	   SUBtract Byte
		    62	 SUBH	   SUBtract Halfword
		    64	 SUBW	   SUBtract Word
		    68	 SUBR	   SUBtract Real
		    6A	 SUBL	   SUBtract Longreal

     Assembler
	Syntax:	    SUB{B,H,W,R,L}  src,des

     Operation:	    dsrc - src --> des

     Flags:  (Integer Operations:  SUBB,SUBH,SUBW)
		    C <-- borrow from most significant bit
		    N <-- des < 0
		    Z <-- des = 0
		    V <-- Integer overflow
		    U <-- 0

     Flags:  (Floating Point Operations:  SUBR,SUBL)
		    C <-- des < 0
		    N <-- des < 0
		    Z <-- des = 0
		    V <-- 0
		    U <-- 0
		    IX <-- des rounded
		    UF <-- des underflowed
		    FZ <-- 0
		    OF <-- des overflowed
		    IN <-- src or dsrc = Nan

     Description:   The source is subtracted from the destination
		    and the result is stored at the address of the
		    destination.

     Exceptions:    Integer overflow, Inexact, Underflow, Overflow,
		    Invalid

     See Also:	    SBR
















				  - 109 -






     TRAP --- TRAP


     Opcode:	    4E	 TRAP	   TRAP

     Assembler
	Syntax:	    TRAP  src

     Operation:	    generate interrupt # (src):
		      stack <-- PS
		      stack <-- PC
		      PC <-- Word at location (8 * src)
		      PS <-- Word at location (8 * src + 4)

     Flags:	    all flags set according to the new PS value

     Description:   The current values of PS and PC are pushed on the
		    stack and the value at location (8 * src) replaces
		    the PC while the value at location (8 * src + 4)
		    replaces the PS.  The source operand is an
		    unsigned Byte.

     Exceptions:    none

     See Also:	    BKPT,RETI
































				  - 110 -






     WAIT --- WAIT


     Opcode:	    AB	 WAIT	   WAIT

     Assembler
	Syntax:	    WAIT

     Operation:	    wait for interrupt

     Flags:	    no changes

     Description:   This instruction causes the processor to idle
		    until it receives an interrupt.

     Exceptions:    none









































				  - 111 -






     XOR --- EXCLUSIVE OR

     Opcodes:	    61	 XORB	   eXclusive OR Byte
		    63	 XORH	   eXclusive OR Halfword
		    65	 XORW	   eXclusive OR Word

     Assembler
	Syntax:	    XOR{B,H,W}	src,des

     Operation:	    src XOR dsrc --> des

     Flags:	    C <-- C
		    N <-- des < 0
		    Z <-- des = 0
		    V <-- 0
		    U <-- 0

     Description:   The destination is set to the exclusive or of the
		    source and the operand at the destination
		    location.

     Exceptions:    none



































				  - 112 -





     4.9  Processor Initialization

     A	processor can be initialized by either asserting the reset pin
     or by executing a RSET instruction.  The resulting initialization
     is	 significantly	different in the two  cases.   They  are  both
     described below.


     4.9.1  Hardware Initialization

     Hardware  initialization  is done by asserting the reset pin  and
     proceeds in several steps:
	  0) External requests are ignored.
	  1)  The ERROR/ pin is latched into bit 31 (the mode flag) of
     the  ID processor register which indicates whether it is  an  I/O
     processor	(1) or an array processor (0).	 If the ERROR/ pin  is
     grounded,	bit 31 is set to 1 indicating that the processor is on
     an I/O board.   A floating ERROR/ pin will cause bit 31 to become
     0	which  implies that the processor is on an array  board.   The
     mode flag is latched when the reset goes away.
	  2) The processor sets memory locations 0..3 to zero, 4..5 to
     AAAA hex and 6..7 to zero.
	  3) The processor state is set to zero except for
	       a) bit 31 in the ID register (see above)
	       b) bits 24-31 of the Configuration register are set by
		  the manufacturing process
	       c) the stack pointer (SP) is set to 8000 hex and the
		  fault register (FR) is undefined
	       d) input and output ready bits are set to 1
	     and interrupts are disabled.
	  4) The  "shadow" ROM on the processor is activated and  the
	     procedure listed below is executed.  Its function is to
	       a) determine whether it is an I/O or array processor
	       b) if it is an array processor then
		    1) it waits to receive a value (halfword) which is
		       the length of the actual message
		    2) it  replies with a status  message  indicating
		       that it is ready to receive the full message
		    3) it  receives the message	 (the  full  software
		       initialization software), loads it starting  at
		       location 8 and jumps to location 1024
	       c) if it is an I/O processor it waits until the host
		  processor  writes a nonzero value in location 0 and
		  then jumps to location 1024 where the I/O
		  initialization software would have been placed.
	       d) a JMP (jump) to the initialization software is
		  executed (the JMP disables the shadow ROM until it
		  is enabled by another reset signal).	The functions
		  performed by the initialization software should
		  include a full set of diagnostics.








				  - 113 -





     4.9.2  Initialization Procedure (shadow ROM)

     The code in the on-chip shadow ROM is listed below with comments.

     !	 During	 shadow	 ROM  execution all  interrupts	 are  disabled
     including interrupts that are not normally maskable;

	       RSET ;

     !	 The RAM chips need 8 refresh cycles to initialize themselves.
     The  refresh rate starts at one refresh every 8 cycles since  the
     Configuration register is set to zero on reset.   We idle for the
     required 64 cycles by looping on RSET 5 times.

	       MOVW #5,R0;
	       REP R0;
	       RSET ;

     !	 The refresh rate is lowered to every 40 cycles by writing a 4
     in	 the Configuration register.   This is conservatively high but
     the operating system can lower it further if the processor	 clock
     rate justifies it;

	       LDPR #4,#CONFIG;

     !	 The Stack Pointer is initialized to the end of memory;

	       LDPR #16r8000,#SPREG;

     !	  Working  memory is now initialized with correct  ECC bits by
     writing 8 bytes;

	       MOVW #0,0;
	       MOVW #16r0000AAAA,4;

     !	Bit 31 of the ID Register is initialized when the reset pin is
     asserted  with  a one if the processor is an I/O processor	 or  a
     zero is the processor is an array processor.   I/O processors are
     initialized from memory while array processors are initialized by
     the serial ports;

	       STPR #IDREG,R0;
	       BL IOINIT;















				  - 114 -





     !	 Array	processor initialization waits for a port to receive a
     message.	The code below assumes that only one port will try  to
     initialize	 the  processor.   If  messages come in at  two	 ports
     exactly at the same time, the code may not work;

     PROCINIT: STPR #INPEND,R0; ! Are any incoming messages pending?;
	       BE PROCINIT;	! No, try again;
	       FFOW R0,R1;	! Yes, R1 gets the port number;

     !	 Initialize the port so DMA transfer of a two byte message  to
     location 0 will occur;

	       LPTR #0,R1;
	       LCNT #2,R1;

     !	Compute in R3 the corresponding output port for a reply;

	       MOVW R1,R3;
	       ADDW #32,R3;
     !	Wait for incoming message DMA to complete;

     INWAIT1:  STPR #INRDY,R2; ! Store Input Ready flags in R2;
	       BITW R2,R0;     ! Test the appropriate flag;
	       BE INWAIT1;     ! Loop until port is ready;

     !	 Start the output port DMA.   The message will be the two byte
     self test status in location 4;

	       LPTR #4,R3;
	       LCNT #2,R3;

     !	 Reinitialize  the same input port to receive the contents  of
     memory;

	       LPTR #8,R1; ! The message will start at location 8;
	       LCNT 0,R1;  ! for the number of bytes indicated by the
			     first message;

     INWAIT2:  STPR #INRDY,R2; ! Wait for input DMA to complete by;
	       BITW R2,R0;     ! testing the appropriate ready flag;
	       BE INWAIT2;     ! and looping back until ready (done);

     !	 Jump  to  a  preset location (1024) to begin  execution  from
     memory.  The JMP resets the "shadow ROM active" flag;

	       JMP 1024;












				  - 115 -





     !	I/O processor initialization.  Wait for memory location 0 or 1
     to	 go  nonzero.	The external processor that loads  the	memory
     image  must wait at least xxx cycles after the RESET  signal  has
     gone away;

     IOINIT;   BITH #-1,0; ! Test halfword at location 0;
	       BE IOINIT;  ! Loop back until it becomes nonzero;

     !	 Jump  to  a  preset location (1024) to begin  execution  from
     memory.  The JMP resets the "shadow ROM active" flag;

	       JMP 1024;

     !	End of shadow ROM code;





			     MEMORY	       ADDRESS
		   ←←←←←←←←←←←←←←←←←←←←←←←←←
		  |  initial message length |	 0
		  |←←←←←←←←←←←←←←←←←←←←←←←←←|
		  |	  reserved	    |	 2
		  |←←←←←←←←←←←←←←←←←←←←←←←←←|
		  |	  test results	    |	 4
		  |←←←←←←←←←←←←←←←←←←←←←←←←←|
		  |	  reserved	    |	 6
		  |←←←←←←←←←←←←←←←←←←←←←←←←←|
		  |	  DMA (Int 1 vector)|	 8
		  |←←←←←←←←←←←←←←←←←←←←←←←←←|
		  |			    |
		  |   hardware interrupt    |
		  |	vector table	    |
		  |←←←←←←←←←←←←←←←←←←←←←←←←←|
		  |←←←←←←←←←←←←←←←←←←←←←←←←←| 1024 (entry point)
		  |			    |
		  |   software interrupt    |
		  |	vector table	    |
		  |←←←←←←←←←←←←←←←←←←←←←←←←←|


















				  - 116 -





     4.10  APPENDIX


     4.10.1  Instruction Format


			     0, 1, 2  Addresses
       OPCODE	MODE	OFFSET/LIT. (opt)   MODE    OFFSET/LIT. (opt)
     -----------------------------------------------------------------
     | OP TP || MD RG |			  | MD RG |		     |
     -----------------------------------------------------------------
     7	43  0 7	 43  0
	|    |							     |
	|    |←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←|
	|				 |
	|				 |
	|
	|		       0,1 or 2 Addresses
	|←←←←←←
	       Low Address in Memory






































				  - 117 -






     4.10.2  Opcode Map

				     TP
				   ------
		 B     H     W		 R     L
	       ----------------------------------------------
		 0     2     4	   6	 8     A     C	   E
	       ----------------------------------------------
	   0   MOVB  MOVH  MOVW	  RES  MOVR  MOVL   RES	  RES
	   1   NEGB  NEGH  NEGW	  RES  NEGR  NEGL   RES	  REP
	   2   SBRB  SBRH  SBRW	  RES  SBRR  SBRL   RES	 REPZ
	   3   CMPB  CMPH  CMPW	  RES  CMPR  CMPL   RES REPNZ
	   4   ADDB  ADDH  ADDW	  RES  ADDR  ADDL   RES	 TRAP
	   5   ADCB  ADCH  ADCW	  RES  SQTR  SQTL   RES	  RES
	   6   SUBB  SUBH  SUBW	  RES  SUBR  SUBL   RES	  RES
      OP   7   SBBB  SBBH  SBBW	  RES  SGNR  SGNL   RES	  RES
	   8   MULB  MULH  MULW	  RES  MULR  MULL   RES	  RES
	   9   DVRB  DVRH  DVRW	  RES  DVRR  DVRL   RES	  RES
	   A   REMB  REMH  REMW	  RES  REMR  REML   RES	  RES
	   B   DIVB  DIVH  DIVW	  RES  DIVR  DIVL   RES	  RES
	   C   BITB  BITH  BITW	  RES	RES   RES   RES	  RES
	   D	RES   RES   RES	  RES	RES   RES   RES	  RES
	   E	RES   RES   RES	  RES	RES   RES   RES	  RES
	   F	RES   RES   RES	  RES	ESC   ESC   ESC	  RES


				     TP
				   ------
		 1     3     5	   7	 9     B     D	   F
	       ----------------------------------------------
	   0   SFTB  SFTH  SFTW	  RES  CVBR   NOP   RES	   BG
	   1   SFAB  SFAH  SFAW	  RES  CVHR   CLC   RES	  BLE
	   2   ROTB  ROTH  ROTW	  RES	RES   STC   RES	  BGU
	   3   FFOB  FFOH  FFOW	  RES  CVLR   CMC   RES	 BLEU
	   4   ANDB  ANDH  ANDW	  RES  CVBL  ERON   RES	  BGE
	   5	ORB   ORH   ORW	  RES  CVHL  EROF   RES	   BL
	   6   XORB  XORH  XORW	  RES  CVWL  BKPT   RES	 BGEU
      OP   7   NOTB  NOTH  NOTW	  RES  CVRL  RSET   RES	  BLU
	   8   ADCD   RES  LDPR	  RES  CVBW    EI   RES	  BNE
	   9   SBBD   RES  STPR	  RES  CVHW    DI   RES	   BE
	   A	RES   RES  LCNT	  RES  CVWB  WAIT   RES	  BNV
	   B	RES   RES  LPTR	  RES  CVWH   RES   RES	   BV
	   C	RES   RES  BCNT	  RES	RES  RETI   RES	 CALL
	   D	RES   RES  BPTR	  RES	RES  RETT   RES	  JMP
	   E	RES   RES  MOVA	  RES	RES   RET   RES	 RETP
	   F	ESC   ESC   ESC	  ESC	ESC   ESC   ESC	  ESC











				  - 118 -





     4.10.3  Addressing Modes

	 ENCODING	SYMBOL
	 MD    REG
	0000  LLLL     #number
	0001  LLLL	  (Integer: -32 to 31)
	0010  LLLL	  (Real: -32 to 31)
	0011  LLLL
	0100  RRRR    (Rn)
	0101  RRRR    (Rn)++
	0110  RRRR    (Rn)+
	0111  RRRR   @(Rn)+
	1000  RRRR   A(Rn)	Byte Offset
	1001  RRRR   A(Rn)	Halfword Offset
	1010  RRRR   A(Rn)	Word Offset
	1011  RRRR  @A(Rn)	Word Offset
	1100  RRRR     Rn
	1101  RRRR   -(Rn)
	1110	    RESERVED
	1111  0000   A(PC)	  Byte Offset
	1111  0001   A(PC)	  Halfword Offset
	1111  0010   A(PC)	  Word Offset
	1111  0011  @A(PC)	  Word Offset
	1111  0100   A(SP)	  Byte Offset
	1111  0101   A(SP)	  Halfword Offset
	1111  0110   A(SP)	  Word Offset
	1111  0111  @A(SP)	  Word Offset
	1111  1000   A		  Byte Offset
	1111  1001   A		  Halfword Offset
	1111  1010   A		  Word Offset
	1111  1011  @A		  Word Offset
	1111  1100    STK
	1111  1101     #number
	1111  1110  RESERVED
	1111  1111  ESCAPE























				  - 119 -





     4.10.4  Processor Registers

	 P0  SP	 Stack Pointer
	 P1  PS	 Program Status
	 P2  FR	 Fault Register		 (read only)
	 P3  CR	 Configuration Register	 (read only: bits 24-31)
	 P4  PI	 Processor I. D.
	 P5  TR	 Timeout Register
	 P6  OR	 Output Ready		 (read only)
	 P7  IR	 Input Ready		 (read only)
	 P8  OE	 Output Enable
	 P9  IE	 Input Enable
	 P10 IP	 Input Pending		 (read only)
	 P11 PE	 Parity Error		 (read only)
	 P12 IO	 Input Overrun		 (read only)

	 Program Status	  Fault Register   Configuration  I/O (P5-P11)
     -----------------------------------------------------------------
      0	 C  Carry		 RU   Fl Pt    RF	    Port0
      1	 V  Integer Overflow	 RS  Rounding  RF	    Port1
      2	 Z  Zero		 GR    Bits    RF	    Port2
      3	 N  Negative		 F1   First    RF  Refresh  Port3
      4	 U  Unordered		 E1  Operand   RF   Rate    Port4
      5	 IX Inexact		 I1 Indicator  RF	    Port5
      6	 UF Underflow		 S1   Bits     RF	    Port6
      7	 FZ Floating Zero Divide F2  Second    RF	    Port7
      8	 OF Overflow		 E2  Operand   CY  Memory   Port8
      9	 IN Invalid		 I2 Indicator  CY   Speed   Port9
     10	 IIX Inexact Enable	 S2   Bits     TY  Memory   R: Reser.
     11	 Reserved		 R: Reserved   TY   Type    R
     12	 Reserved		 R	       R: Reserved  R
     13	 Reserved		 R	       R	    R
     14	 Reserved		 R	       R	    R
     15	 IV Int Overflow Enable	 R	       R	    R
     16	 CE Correc. ECC Enable	 R	       R	    R
     17	 TO Timeout Enable	 R	       R	    R
     18	 II Input Enable	 R	       R	    R
     19	 IO Output Enable	 R	       R	    R
     20	 IE Interrupt Enable	 R	       R	    R
     21	 T  Trace Enable	 R	       R	    R
     22	 Reserved		 R	       R	    R
     23	 Reserved		 R	       R	    R
     24	 RC  Round		 R	       MN	    R
     25	 RC  Control		 R	       MN	    R
     26	 RR			 R	       MN	    R
     27	 RR  Repeat		 R	       MN  Model    R
     28	 RR  Register		 R	       MN  Number   R
     29	 RR			 R	       MN	    R
     30	 RM  Repeat		 R	       MN	    R
     31	 RM  Mode		 R	       MN	    Port31








				  - 120 -





     4.10.5  Interrupts

	0	Reserved
	1	Trace
	2	Breakpoint
	3	Integer Overflow
	4	Integer Zero Divide
	5	Inexact
	6	Underflow
	7	Floating Zero Divide
	8	Overflow
	9	Invalid
       10	Unimplemented Opcode
       11	Address Error
       12	Stack Overflow
       13	Timeout
       14	Correctable ECC Error
       15	Uncorrectable ECC Error
       16	Operand Error
       17-31	Reserved
       32-41	Output Ready
       42-62	Reserved
       63	Output Ready (Host)
       64-73	Input Ready
       74-94	Reserved
       95	Input Ready (Host)
       96-105	Input Error
       106-126	Reserved
       127	Input Error (Host)


     4.10.6  Branch Conditions

	G   (N or Z) = 0		GU   (C or Z) = 0 or U = 1
	GE	   N = 0		GEU	    C = 0 or U = 1
	L	   N = 1		LU	    C = 1 or U = 1
	LE  (N or Z) = 1		LEU  (C or Z) = 1 or U = 1
	E	   Z = 1		NE	    Z = 0




















				  - 121 -





     4.10.7  Instruction Timing

     The  numbers listed below are the number of clock cycles required
     by	 the instruction assuming register to register	operation  and
     full  execution  unit pipelines.  (The additional times for  more
     complicated  addressing modes or empty pipelines are  also	 given
     below.)   If the speed depends on the size of the	operands,  the
     speeds  are  given with the assumed operand size in  parentheses.
     The instructions are divided according to the unit that  performs
     the   operation.	 The  floating	point  unit  performs  integer
     multiply,	divide and remainder as well as all the floating point
     operations.

     Timing for addressing modes:

	     for src operands
	     for dsrc operands
	     for dst operands
	     develop a table of exceptions (e.g. stk, indirect)

     Timing for empty pipelines:





































				  - 122 -





     Integer Execution Unit

     ADC    2
     ADCD   4
     ADD    2
     AND    2
     B	    6 if branch taken (into cache), 3 if branch not taken
     BCNT   7+(0-4) arbitration (usually 0)
     BIT    2
     BKPT   2
     BPTR   7+(0-4) arbitration (usually 0)
     CALL  12
     CLC    2
     CMC    2
     CMP    2
     CVBW   2
     CVHW   2
     CVWB   3
     CVWH   3
     DI	    2
     EI	    2
     ERON   2
     EROF   2
     FFO    5(B,H) 4(W) if input=0, else #+[7(B) 6(H) 4(W)] where # is
			number of ones in result [max=3(B) 4(H) 5(W)]
     JMP    5
     LCNT   6+(0-4) arbitration (usually 0)
     LPTR   6+(0-4) arbitration (usually 0)
     LDPR   4
     MOV    2
     MOVA   2
     NEG    2
     NOP    2
     NOT    2
     OR	    2
     REP    8+[bytes in next instruction/2]+4*number of iterations
     RET   10
     RETI  16
     RETP  13
     ROT    9(B) 7(H) 4(W)
     RSET   2
     SBB    2
     SBBD   4
     SBR    2
     SFA    6(B,H) 4(W)
     SFT    6(B,H) 4(W)
     STC    2
     STPR   4
     SUB    2
     TRAP  35 (same for interrupt)
     WAIT   2
     XOR    2






				  - 123 -






     Floating Point Unit

     ADD   17-27(R) 17-41(L)
     CMP    6
     CVLR  20
     CVRL  21
     DIV   41(I) 34(R) 63(L)
     MOV    3
     MUL   26(I) 20(R) 34(L)
     NEG    4
     REM   40(I) 25-90(R) 39-100(L)
     SGN    3
     SQT   34(R) 62(L)












































				  - 124 -





     5	The Software

     5.1  Introduction

     This  chapter  will  cover  the  various  aspects  of  the  NCUBE
     operating system.   There are two levels of operating software in
     the  NCUBE  system:  the  Monitor (in EPROM)  and  the  Operating
     System.   The Monitor is a simple,  single user system that is in
     effect when the system is powered on.   The Monitor uses terminal
     0 and provides extensive diagnostic and management functions (see
     5.2 for details).   The Operating System,  AXIS (AXIS is an NCUBE
     trademark),  is  automatically invoked if the system is in Normal
     mode and passes the diagnostic tests.   AXIS is a fully protected
     multiuser,  multitasking operating system with complete  resource
     management  including  memory,  main  array,  graphics  and  file
     system.   The  file  system has a hierarchical structure  and  is
     distributed  across all the disk drives in the system.   Thus,  a
     user  can  access  his files regardless  of  which  terminal  (or
     Host Board) he uses.

     In  many ways the Operating System is similar to UNIX (UNIX is  a
     Bell  Laboratories trademark).   A user who is familiar with UNIX
     will find the AXIS System very easy to learn;  however, the NCUBE
     System has several additional facilities including

	  1)  system temperature sensing
	  2)  distributed file system
	  3)  array management
	  4)  uniform file protection

     The AXIS System is described in detail in section 5.3.



























				  - 125 -





     5.2  The Monitor

     5.2.1  Introduction

     The Monitor is contained in the system EPROM and is invoked  when
     the  system is powered on.   The Monitor always communicates with
     Terminal  0 on Host Board 0 (the System  Console)  for displaying
     messages and receiving commands.  When the system mode switch  on
     the  front panel is in  the   "Normal"   position,   the  Monitor
     runs  the  diagnostics  and  boots  the Operating System  (if the
     diagnostics run successfully).   If the mode  switch  is  set  to
     "Diagnostic",  the  Monitor goes into a single user system  after
     successfully   running  the  diagnostics.    The  Monitor  system
     provides   a  large  range  of  offline  diagnostic  and   backup
     facilities.

     The  Monitor consists of two parts:   the ROM Monitor and the RAM
     Monitor.   They are both in the system EPROM but the ROM  Monitor
     uses  no  RAM even for stack space while the  RAM  Monitor,  when
     invoked, is copied to RAM and uses RAM for data.  The ROM Monitor
     starts  the system and executes the diagnostics up to the  memory
     test  phase.    If  memory  test  passes,   the  RAM  Monitor  is
     automatically invoked;  but if it fails,  the system stays in the
     ROM  Monitor and a few simple commands are available (see 5.2.3).


































				  - 126 -





     5.2.2  Monitor Diagnostics

     The facilities tested by the Monitor diagnostics are listed below
     in order.

	  1) The two front panel LEDs are turned on and the ROM
	     Monitor is started
	  2) The EPROM contents are verified (a checksum is computed)
	  3) All I/O devices except the disk controller are
	     initialized.
	  4) The Serial Channel for Terminal 0 is tested
	  5) If (2) or (4) fail, the LEDs remain on and the system
	     hangs indicating that Host Board 0 is bad.
	  6) If (2) and (4) pass, then the LED labeled "STATUS 2" is
	     turned off, appropriate characteristics are set for
	     Terminal 0 (19200 baud rate, etc) and the system startup
	     message, "NCUBE Parallel Processor Peripheral Subsystem",
	     is displayed.
	  7) System memory (RAM) is tested and any errors (including
	     corrected ECC errors) are displayed. If there are memory
	     errors or the Diagnostic Mode is on, the system stays in
	     the ROM Monitor, prints "ROM-Only Diagnostic Monitor"
	     followed by a "$" prompt and waits for user commands.  If
	     there are no memory errors and the system is in Normal
	     Mode, the RAM Monitor is invoked and the diagnostics
	     proceed.
	  8) The Disk Controller is tested if any disks are connected.
	  9) Power Supply status and control signals are checked.
	  10) The Printer state is checked.
	  11) The System ID and slot numbers are checked.
	  12) All Temperature Sensors are tested and the temperature
	      is displayed.  If the temperature is above 38 degrees C.
	      the system is shut down.
	  13) The Real Time Clock state and operation are checked.
	  14) All Interrupt Controllers are tested for state and
	      response.
	  15) The remaining Serial Channels are tested.
	  16) The Timer (8253) is tested.
	  17) The Floating Point Processor (80287) is tested.
	  18) The DMA controller is checked.
	  19) Any SBX Modules connected to the system (as indicated
	      by an EPROM table) are tested.

       If the system is in Normal Mode and a disk is connected then
	  20) The disks are started and the controller is tested.
	  21) The disks are checked and fixed if a system crash was
	      the cause of the last shutdown.
	  22) The Operating System is booted.
       Otherwise
	  20) The system stays in the RAM Monitor, a ">" prompt is
	      displayed and the system waits for a command.







				  - 127 -





     5.2.3  ROM Monitor Commands

     Since the ROM Monitor does not use RAM,  its commands are few and
     simple.   They  are  listed below and are invoked by  typing  the
     first   letter  in  the  command name.   A <CR> causes a new  "$"
     prompt  to  be displayed.   A "↑C" can be typed at any  time  and
     whatever is happening will be aborted and a new prompt displayed.
     The  operand  specifications  for the  commands  are  defined  as
     follows

	       ADDR consists of two 4 digit hexadecimal numbers
		    separated by a colon.  The first number is the
		    segment selector and the second is the offset.
		     ←←
	       LENGTH  |
		       |
	       IOADDR  | are 4 digit hexadecimal numbers.
		       |
	       VALUE←←←|

	       SEG MAX is the number of 64 Kbyte segments of memory to
		       be tested (starting from memory address 0).




			 COMMANDS



     continue

	  Restarts the disk operating system after a "debug" stop.



     display <ADDR>,<LENGTH>

	  A section of memory from ADDR to ADDR+LENGTH-1 is displayed
	  in the following format

	  ADDR	 hhhh hhhh hhhh hhhh hhhh hhhh hhhh hhhh    < ascii >

	  where ADDR is the beginning address, "hhhh" represents a
	  16 bit word in hex and the ASCII equivalent of the 8 words
	  is also displayed ("." represents unprintable characters).



     goto ram monitor

	  The RAM Monitor is booted (see 5.2.4).






				  - 128 -





     help

	  The list of ROM Monitor commands and operands is displayed.



     input <IOADDR>

	  The value at I/O address IOADDR is displayed.	 Typing a
	  <LF> repeats the command with the same operand and a <CR>
	  terminates it.



     memory test <SEG MAX>

	  SEG MAX 64 Kbyte segments of memory are tested starting at
	  memory address 0.



     output <IOADDR>,<VALUE>

	  VALUE is written to I/O address IOADDR.  A <LF>
	  repeats the command at the same address but allows a
	  different VALUE to be typed and <CR> terminates it.



     power down

	  The system is powered down.



     set <ADDR>

	  The value in memory at ADDR is displayed and can be altered
	  by typing a new value.  A <LF> advances to the next word in
	  memory and repeats the command.  A <CR> terminates it.


















				  - 129 -





     5.2.4  RAM Monitor Commands

     The  RAM Monitor is invoked automatically if the diagnostics pass
     the  memory  test or explicitly by typing "g" in response to  the
     ROM Monitor prompt.   The RAM Monitor Commands are of four types:
     general,  debugging,  disk control or tape control.   The general
     commands  are invoked by typing the first letter of  the  command
     name.   The debugging, disk control and tape control commands are
     invoked by first typing "y", "x" or "t" respectively, followed by
     the  first letter of the specific command name.   If <CR>  is the
     first character typed, a new monitor prompt, ">",  is printed and
     the command analyzer is restarted.   A "↑C" can be typed  at  any
     time and reguardless of what is happening, it will be aborted and
     a new prompt will be displayed.

     The operand specifications are the same as the ROM Monitor's (see
     5.2.3) but with several additions.

	       FILENAME is the pathname of a file

	       FILE SPEC is the name of a file or directory

	       SCCNUM is the Serial Communication Channel number (0-7)

	       SRC ADDR and DEST ADDR are the same as ADDR (see 5.2.3)

	       SECTOR is a disk address and consists of two
	       hexadecimal numbers separated by a colon.  The first is
	       the cylinder number and the second denotes the head and
	       sector (the high order byte is the head number and the
	       low order byte is the sector number).

	       DISK NUMBER is a decimal number between 0 and 3 that
	       designates a particular disk drive connected to the
	       Host Board.

	       REG is an 80286 register name (AX, BX, CX, DX, BP, SI,
	       DI, SP, IP, FL, CS, DS, SS, ES)

	       TSECTOR is a tape address.  It is a hexadecimal number
	       from 0 to 64K that indicates a specific 1024 byte
	       sector on the tape.

     In  order  to access files that are not on system disk 0,  it  is
     necessary to first select the disk using the disk command  called
     "initialize controller" (see 5.2.4.3).












				  - 130 -





     5.2.4.1  General RAM Monitor Commands

     The  general commands are invoked by typing the first  letter  of
     the name of the command.






















































				  - 131 -








     ascii dump <FILENAME>

	  The contents of the file FILENAME are displayed in hex and
	  ascii.  The format is shown below

	  offset  hhhh hhhh hhhh hhhh hhhh hhhh hhhh hhhh   < ascii >

	  where "offset" is the byte offset from the beginning of the
	  file, "hhhh" represents a 16 bit word in hex and "ascii"
	  represents the 8 words interpreted as ASCII characters
	  (unprintable characters are displayed as ".").



     baud rate <SCCNUM>,<VALUE>

	  The baud rate at I/O address IOADDR is set to VALUE in
	  decimal format (e.g. 19.2 kbaud is typed as 19200).



     change directory <FILE SPEC>

	  The current directory is changed to FILE SPEC.  If FILE
	  SPEC begins with a "/", it replaces the current directory.
	  If FILE SPEC is typed without an initial "/", it is appended
	  to the current directory.  If <CR> is typed instead of a
	  FILE SPEC, the current directory is displayed.



     display <ADDR>,<LENGTH>

	  Memory from ADDR to ADDR+LENGTH-1 is displayed in the same
	  format as "ascii dump" (see above).



     execute <FILENAME>

	  The file FILENAME, which must be executable, is run under
	  the single process AXIS environment. The following three
	  directories are searched (in the order given) for FILENAME:
	  "." (the current directory), "/bin", and "/sys/prom/bin".
	  This command can only be used with a restricted set of
	  programs.  Examples of programs that can be run are "nm",
	  "as" and "et".








				  - 132 -





     file system subtree remove <FILE SPEC>

	  The named subtree is removed from the file system



     goto rom monitor

	  The ROM Monitor is invoked.  This allows the use of the ROM
	  commands without disturbing memory.



     help

	  The list of general commands with their operands is
	  displayed.



     input <IOADDR>

	  The value at I/O address IOADDR is displayed.	 Typing a
	  <LF> repeats the command and <CR> terminates it.



     jump <ADDR>

	  Branch to location ADDR.



     list directory <FILE SPEC>

	  The contents of directory FILE SPEC are listed in the
	  following format:

	  system type  rights  file type  # bytes  date created	 name



     move memory <SRC ADDR>,<LENGTH>,<DEST ADDR>

	  The block of memory from SRC ADDR to SRC ADDR+LENGTH-1 is
	  moved to DEST ADDR.












				  - 133 -





     new time set

	  After <CR> is typed the current time is displayed.  A
	  prompt is then displayed for new time components (Year,
	  Month, Day, Hour, Minutes and Seconds).  The numbers are
	  typed in decimal format. If a <CR> is typed for any
	  prompt, that component is set to zero.



     output <IOADDR>,<VALUE>

	  The I/O address IOADDR is set to VALUE.  A <LF> repeats
	  the command allowing a new VALUE to be typed.	 A <CR>
	  terminates it.



     port <SCCNUM>

	  A connection to port (I/O address) VALUE is established.
	  This allows terminal emulation.  Typing "↑space bar"
	  terminates the connection.



     remove <FILENAME>

	  The file FILENAME is removed from the file system.


     set <ADDR>

	  The contents of memory at ADDR is displayed and can be
	  altered by typing a new hex value.  Typing a <LF>
	  causes the command to be repeated for the word at the
	  next higher address.	A <CR> terminates the command.



     tape <COMMAND>

	  If the user types a "t", "tape" is displayed and must be
	  followed by a tape control command (see 5.3.1.4)



     vsystem temperature

	  The current temperature inside the system enclosure is
	  displayed in degrees centigrade.







				  - 134 -





     wtype <FILENAME>

	  The contents of the file FILENAME are typed on the terminal
	  screen. The standard controls "↑S" and "↑Q" are used to
	  stop and restart the display.



     xdisk <COMMAND>

	  If the user types "x", "xdisk" is displayed and must be
	  followed by a disk control command (see 5.2.4.3).



     ydebug <COMMAND>

	  After typing "y", "ydebug" is displayed and must be
	  followed by one of the debugging commands (see 5.2.4.2).



     ztime

	  The current clock time is displayed in hex and human
	  readable formats.
































				  - 135 -





     5.2.4.2  Debugging Monitor Commands

     The  debugging commands are invoked by first typing "y"  followed
     by the first letter of the command name listed below.


     change register <REG>

	  The current value contained in register REG is displayed and
	  the user may change it by typing a new value.	 Typing a <LF>
	  causes the command to be repeated for the next register in
	  the sequence (see REG above).	 A <CR> terminates the
	  command.



     help

	  The list of debugging commands with their operands is
	  displayed.



     registers

	  The current values of all the registers are displayed.



     status

	  The current status of the disk controller registers is
	  displayed.



     trace <ADDR>

	  The value of CS:IP saved from the last invokation of
	  "trace" is displayed and trace waits for a new CS:IP.	 If
	  <CR> is typed, CS:IP is unchanged.  The value of  CS:IP
	  is again displayed along with the values of the other
	  registers (AX,BX,CX,DX,BP,SI,DI,SP) and trace waits for a
	  response.  Typing <LF> causes the instruction at
	  CS:IP to be executed.	 All the registers are displayed
	  and trace again waits for a response.	 Typing a <CR>
	  causes the RAM Monitor to be invoked.











				  - 136 -





     5.2.4.3  Disk Commands

     Disk  commands  are invoked by first typing "x" followed  by  the
     first letter of the command name listed below.


     ascii dump <SECTOR>

	  The data at disk address SECTOR is displayed in hex and
	  ascii.  The format is the same as for "ascii dump FILENAME".



     boot operating system

	  Boot checks the system for "crash", verifies the disks and
	  boots a new operating system.	 This is useful for restarting
	  after a crash.  Type "↑C" to get the logon prompt.



     clear disk state

	  Reset the disk controller registers.



     disk format and init <DISK NUMBER>

	  The indicated disk is formatted and initialized.  This is a
	  physical initialization so a warning message is first
	  printed since any data on the disk will be lost.  CONSULT
	  NCUBE BEFORE USING THIS COMMAND.



     format sector <SECTOR>

	  The specified SECTOR is reformatted without disturbing any
	  other sectors.  CONSULT NCUBE BEFORE USING THIS COMMAND.



     help

	  The list of disk control commands is displayed.



     initialize controller <DISK NUMBER>

	  The disk controller hardware is initialized and the
	  specified disk is selected.





				  - 137 -





     list bad sectors

	  Displays the number (hex) and locations of bad sectors.



     new file system

	  This is a logical initialization of the selected disk drive.
	  The command requests:	 "enter disk system name";  the user
	  responds with a name of up to 24 characters.	The disk is
	  then erased and prepared for the new file system storage.
	  CONSULT NCUBE BEFORE USING THIS COMMAND.



     power down system

	  The system is powered down.



     read sector <SECTOR>,<ADDR>

	  The data at disk address SECTOR is read into memory
	  starting at address ADDR.



     status

	  Display the contents of the disk controller registers.



     test read

	  All sectors are tested.  If an error is found, the disk
	  status is displayed and the command is terminated.



     verify disk

	  "verify" checks for and corrects most file system
	  inconsistencies.  This is used after crashes.



     write sector <SECTOR>,<ADDR>

	  The 1024 byte block of data at memory address ADDR is
	  written on the disk at address <SECTOR>.  CONSULT
	  NCUBE BEFORE USING THIS COMMAND.




				  - 138 -





     5.2.4.4  Tape Control Commands

     The  tape  control  commands  are invoked  by  first  typing  "t"
     followed by the first letter of the name of the command.


     ascii dump <TSECTOR>

	  The contents of the indicated sector on the tape are
	  displayed.  The format is the same as the disk version of
	  ascii dump.



     backup files <FILE SPEC>

	  The indicated file (or files if FILE SPEC is a directory) is
	  written on tape.  The question is asked:  APPEND?  If a "y"
	  is typed, the file is appended to the existing contents of
	  the tape.  If "n" is typed, the file is saved at the
	  beginning of the tape, overwriting whatever was there.



     certify

	  Initialize a new tape, create a bad sector list and store
	  it on the tape.



     display <ADDR>,<LENGTH>

	  Memory in the tape controller subsystem from ADDR to
	  ADDR+LENGTH-1 is displayed.



     help

	  The list of tape control commands is displayed.



     list directory

	  The pathnames of all files saved on the tape are listed.











				  - 139 -





     restore files <FILE SPEC>

	  The indicated file (or files if FILE SPEC is a directory) is
	  located on the tape and written to the disk.	The question
	  is asked:  AS?  A new FILE SPEC is expected which becomes
	  the FILE SPEC on the disk.



     set <ADDR>

	  The value in the memory of the tape controller subsystem at
	  ADDR is displayed and can be altered by typing a new value.
	  A <LF> advances through controller memory and repeats
	  the command while <CR> terminates it.



     tape status

	  Display the status registers of the tape controller
	  subsystem.



     unload

	  Rewind tape and release mechanism for unloading tape.



     write sector <TSECTOR>

	  A 1024 byte block of data is written from the special
	  tape sector area of NCUBE system memory to the specified
	  sector on the tape.



     xlist bad sectors

	  Read and display bad sector list from tape.



     yreset

	  Reset the tape controller hardware.










				  - 140 -





     5.3  The Operating System



     5.3.1  Overview

     The   NCUBE   operating  system,  AXIS,  is  a  high  performance
     UNIX-style  interface   to  the  NCUBE  hardware.    It  supports
     multiple    users,   including    password   and   billing,   and
     multitasking.   The editor, NMACS,  is  screen  oriented  and  is
     similar  to  a  simplified version of EMACS.   The file system is
     the most prominent feature of  the operating   software   because
     nearly   every   system   resource  is treated as a type of file.
     The file system is hierarchical like UNIX   but   has   extensive
     mechanisms   for  file  protection  and sharing.   The  operating
     system treats memory as a collection  of  segments  that  can  be
     allocated  and  shared.   Processes  are  created  and  scheduled
     (priority,  round robin) by the system and provide part  of   the
     protection  facility.    There  is  a   debugger   and  a linking
     loader.  One of the unique facilities of the NCUBE system is  the
     management  of  the  main  processing  array.  It is managed as a
     device and each process requests subsets of the array  which  are
     allocated   according  to  availability.    Fault  tolerance   is
     supported by the system since it periodically runs diagnostics on
     the  array  and  if any nodes fail,  they are mapped out  of  the
     allocatable  resource and the operator is informed of the  fault.
     All  of the facilities listed above are described in more  detail
     below.



     5.3.1.1  File System

     The  file system is the user's uniform interface to almost all of
     the  system resources.   The two main entities in the file system
     are directories (5.3.1.1.1) which provide the structure and files
     (5.3.1.1.2)  which  contain  the  data.    Most  resources  (e.g.
     printers,  terminals,  processing  array) are treated as  devices
     which are simply one type of file.   A file has a name which both
     uniquely  identifies  it and indicates its position in  the  file
     structure.   Files  have a set of operations defined that can  be
     performed  by a user having the requisite privileges.   The types
     of files supported,  the file structure and  protection,  and the
     file operations are described below.














				  - 141 -





     5.3.1.1.1	File System Structure

     The  file system structure is managed by directories (see  DIR(5)
     in   section   5.3.2.5)  which  are  nodes  in  the  tree.   AXIS
     directories are created implicitly simply by  referring  to  them
     (e.g.  cat, cp) so there is no need for a "mkdir" command.  There
     are three types of directory entries.

	  1)  Names of files or directories at the next level down the
	      tree.  These names are called "components".

	  2)  Device Directory pointers ("ddirs") which are pointers
	      to other file structured devices.

	  3)  Links which are names of files that contain pathnames.
	      Pathnames are explained below.

     Each  of  these  directory  entry  types  provides  an  important
     function which will be described.

     The first type of directory entry,  component names,  is the most
     common  and provides the system naming convention.   In order  to
     provide a full name,  called a pathname,  of a file or directory,
     one  types  the component names separated by "/" starting at  the
     top.  Thus, the pathname

			 //cb0/sys/bin

     refers to a file or directory called "bin" in directory "sys"  in
     directory "cb0" which is in the root called "//".

     The  next  type  of  directory  entry,   called  "ddirs"  (device
     directory   pointers),  are used to make the AXIS file  structure
     a networked or distributed file system.   A single  NCUBE  system
     has  up  to 8 Host Boards, each of which can manage up to  4 disk
     drives.   Each disk in a system has a root directory  called  its
     device  directory.   The device directory of disk0 is the root of
     all  file  systems  on  disks   controlled   by   a    particular
     Host Board.   Each  NCUBE system has a unique  system number that
     is physically installed in its backplane.  A ddir has embedded in
     it the quantity

		      [system # | I/O Board # | drive  #]

     which allows the operating system to locate the device  directory
     for any disk in a set of NCUBE systems.   The capability provided
     by   ddirs   makes  AXIS  a true networked file system permitting
     file sharing across all physically connected NCUBE systems.










				  - 142 -





          Typically,  the  device  directory of disk0  (called   "//")
     will contain:

	  1) The name of another directory ("cb0") which acts as the
	     real root of the file structures on disk0.

	  2) ddirs for the other drives connected to the same
	     Host Board.

	  3) ddirs for disk0 on any other Host Boards in the system.

	  4) ddirs for disks on any other physically connected NCUBE
	     system.  Since "system #" is one of the components of a
	     ddir, it can refer to disks on other NCUBE systems.


     The  following diagram illustrates a typical situation  with  two
     Host Boards each with two disk drives.








































				  - 143 -





      Host Board 0				    Host Board 0
	 Disk0					       Disk1
	 "//"			"cb0"
      ←←←←←←←←←←←←	      ←←←←←←←←←←	       ←←←←←←
     | cb0	  |--------->| ALL DIRS |<--|	      | cb1  |-----|
     | cb1 (ddir) |-----|    |	 ON	|   |	      |←←←←←←|	   |
     |	:	  |	|    |	DISK0	|   |			   |
     |	:	  |	|    |←←←←←←←←←←|   |	      "cb1"	   |
     | cb4 (ddir) |--|	|		    |	    ←←←←←←←←←←	   |
     |←←←←←←←←←←←←|  |	|-------------------|----->| ALL DIRS |<---|
		     |			    |	   |   ON     |
		     |			    |	   |  DISK1   |
		     |			    |	   |←←←←←←←←←←|
		     |			    |
	   |---------|----------------------|
	   |	     |
	   |	     |
	   |	     |
	   |	     |-----------------------|
	   |				     |
	   |				     |
	   |				     |
	   |				     |	    ←←←←←←←←←←
	   |---------|	|--------------------|---->| ALL DIRS |<---|
		     |	|		     |	   |   ON     |	   |
      ←←←←←←←←←←←←   |	|		     |	   |  DISK5   |	   |
     | cb0 (ddir) |--|	|		     |	   |←←←←←←←←←←|	   |
     | cb5 (ddir) |-----|      ←←←←←←←←←←    |	      "cb5"	   |
     | cb4	  |---------->| ALL DIRS |<--|			   |
     |	:	  |	      |	   ON	 |	    ←←←←←	   |
     |	:	  |	      |	  DISK4	 |	   | cb5 |---------|
     |←←←←←←←←←←←←|	      |←←←←←←←←←←|	   |←←←←←|
	 "//"
	Disk0					    Disk1
      Host Board 1				  Host Board 1























				  - 144 -





     The  third type of directory entry is called a link.   A link  is
     the  name  of  a file that contains a pathname of   a   file   or
     directory.   When  a  file is created,  an actual pointer to  the
     physical file is created.   Thereafter, links to that file may be
     created  but  there  is still only one pointer since  a  link  is
     simply  the  text of a pathname.   The usefulness of  links  will
     become clear after we discuss protection.

     Thus  far we have seen how the file system is structured and  how
     pathnames  work.   We will now discuss the naming conventions  in
     the  user  interface of the system.   There are several  ways  to
     reduce  the required typing when referring to files.   The  first
     shorthand  convention  is  that  one slash ("/")  followed  by  a
     component "name" substitutes for

			 //cbx/name

     where "cbx" is the root of the disk0 of the Host Board to   which
     the  terminal  is  connected.   So if  a  user  is  on Host Board
     0 and he types

			 /sys

     he is referring to the object whose full pathname is

			 //cb0/sys

     The  second  shorthand  convention relies on  the  concept  of  a
     "preface"  directory.   Every user has an account  file  that  is
     created by the system administrator.   One of the entries in that
     file is a preface directory.   If a user has a non-null  preface,
     it is  substituted for the first slash in a pathname.   A typical
     preface is

			 //cb1/usr/steve

     and if the owner of that preface types

			 /x

     he is actually referring to

			 //cb1/usr/steve/x















				  - 145 -





     This  supports a powerful level of file protection since  a  user
     can  not access files outside of his preface.   (If a user has  a
     non-null preface,  even if he tries to type "//", the system will
     treat it as "/".)

     There are two exceptions to the above statements.   If a user has
     superuser rights, even if he has a preface, he can override it by
     starting his pathname with "//".   Links are the other exception.
     Links  are full pathnames and are textually substituted  whenever
     they are referred to.  For example, if a user has a preface of

			 //cb1/usr/steve

     and in
			 //cb1/usr/steve/com

     he has a link named "sys" whose content is

			 /sys

     then when he types

			 /com/sys/x

     he is referring to

			 //cb0/sys/x

     because  as  soon as the system sees the "sys" as the name  of  a
     link,  it  substitutes  the text of the link in place of all  the
     previous  components.   Since they bypass the preface  protection
     mechanism, links are dangerous.  In order to create links, a user
     must  be granted that right by the system administrator  ("create
     links" is a privilege flag in the account file).

     Although  links  bypass the preface,  there is another  level  of
     protection  that  they  do not  subvert.   Each  component  of  a
     pathname has associated with it certain rights (e.g. read, write,
     see  DIR(5)  in  section  5.3.2.5).   In  order  to  perform  any
     operation  on  an object,  the right for that operation  must  be
     enabled  in  each component of the pathname used to refer to  the
     object.   This applies to links as well as any other name.  So if
     user1  has a file he wants to let user2 read but  not  write,  he
     creates  a  link to the file,  reduces the rights and stores  the
     link in one of user2's directories.   Links are also used to give
     users restricted access to system facilities.












				  - 146 -





     The third way of shortening names is to use the working directory
     concept.   A user's account file has an initial working directory
     which  can  be  changed by using the "cd"  command  (see  section
     5.3.2.2).   The working directory is invoked by beginning a  name
     with  a pathname component (no initial slash).   For example,  if
     the working directory is

			 /test

     and the preface is

			 //cb1/usr/steve

     then simply typing "x" refers to

			 //cb1/usr/steve/test/x

     since the naming convention with no "/" is

			 preface/working directory/x


     The naming conventions and file system structure are very similar
     to UNIX.  However, ddirs, links, the preface directory and access
     rights in pathname components are useful AXIS extensions.

































				  - 147 -





     5.3.1.1.2	Files

     A  file in the AXIS system is  simply  a  string  of  from  0  to
     2**32-1  bytes  with  each byte directly addressable.   There are
     several types of files recognized by the system.  These include

	  1) system files:  These are files used for special purposes
	     by the AXIS system.  They are found in "/phy" (5.3.2.4).

	  2) device files:  These are files that represent physical
	     devices like printers and terminals.  They are found in
	     "/dev" (5.3.2.4).

	  3) binary files:  Binary files are treated as a string of
	     bytes with no interpretation given to any bit grouping.

	  4) executable files:	These files contain compiled or linked
	     object code that can be executed by typing the name to
	     the shell or using the "run" system call.	The format of
	     "exe" files is given in section 5.3.2.5.

	  5) relocatable object files:	These files are used as input
	     to the linker or locator.	The format of "rel" files is
	     found in 5.3.2.5.

	  6) text files:  Most files are text files--simply strings of
	     ASCII characters representing a printable file.

     The  file type is an 8 bit code that is associated with the file.
     The  codes 0,1,...,15 are reserved for NCUBE but from 16  to  255
     the  codes  can be user defined.   There is also an  8  bit  file
     subtype  that is not interpreted by the system and  is  available
     for user definition.   This user subtyping even applies to  NCUBE
     reserved types.  Thus, a user could write a special print routine
     that  would print any "text" file  (an  AXIS  file  type)  except
     those  with   a   "secret"   subtype.    File format details  are
     given  in section 5.3.2.5.

     There are several types of files but one uniform way to refer  to
     them  through  various  operations.    There  are  two  types  of
     operations,  those  that  allow access to elements of a file  and
     those  that  treat a file as an undivided  unit.  Both  types  of
     operations are described below.   File system commands and system
     calls are specified in detail in sections 5.3.2.1 and 5.3.2.2.














				  - 148 -





			    Access System Calls



     "open" ("create") filename:  The file whose name is "filename" is
     opened  (or  created)  in the current  working  directory  and  a
     channel number is returned.   Opening a file consists of creating
     an entry,  called a file descriptor,  in the "open file table" of
     the process.  The channel number is the index of the entry in the
     table  and  is used by the other access commands to refer to  the
     file.    One  of  the  fields  in  the  file  descriptor  is  the
     filepointer which is initialized to zero and is used by the other
     access  commands to refer to individual elements (bytes  in  data
     files) in the file.  Another field has the rights associated with
     the  pathname indicated by "filename".   Any of the system  calls
     listed  below will be permitted only if the corresponding  rights
     are enabled.


     "close"  channel:   The  file  with the given channel  number  is
     closed (its entry in the open file table is deleted).


     "seek" channel,offset:   The filepointer for the file  referenced
     by the channel number is set to the value of offset.


     "read"  channel,length,buffer:   The  bytes from  filepointer  to
     filepointer  +  length  - 1 are read from the  file  into  memory
     starting  at the location pointed to by "buffer".   The value  of
     filepointer is incremented by "length".


     "write" channel,length,buffer:  The bytes ("length" in number) in
     memory  starting  at  the  location pointed to  by  "buffer"  are
     written  into  the file starting at  byte  number  "filepointer".
     Filepointer is incremented by "length".


     "special  operation" channel,function [,buffer]:   These  special
     operations  indicated  by "function" (with "buffer" when  needed)
     are defined for particular types of files (usually devices).  For
     example, printer speed and font are set by special operations.


			      Unit Commands


     The commands that treat files as units include cat (catenate), cp
     (copy),  rm  (remove) and cd (change  directory).   For  detailed
     specifications of file commands see section 5.3.2.1.







				  - 149 -





     5.3.1.2  Editing

     There are three editors in the AXIS  system.    One  is  a   line
     editor  called  "ed".  It is compatible with the "ed" line editor
     in UNIX.  Another  is  a stream editor whose name is "sed".   Sed
     is  also compatible with the UNIX stream editor of the same name.
     Both ed and  sed  are  summarized  in  section   5.3.2.1.     For
     detailed  information  see  the  extensive literature on standard
     UNIX systems  (e.g.  B.  W.  Kernighan's  reports:   "A  Tutorial
     Introduction  to  the ED  Text  Editor" and "Advanced editing  on
     UNIX").   The  third  editor  is  a  screen  editor  called  "nm"
     (NMACS).    It is similar to the widely used screen editor EMACS.
     NMACS is also summarized in section  5.3.2.1  but   since  it  is
     not   exactly   compatible  with another editor, we will describe
     it in some detail here.











































				  - 150 -





     5.3.1.2.1	NMACS


     The NCUBE screen editor, "nm" (NMACS)  is  similar  to  the  well
     known  EMACS.  However, there are enough differences that we will
     describe it here in detail.  A summary of NMACS is  in  NM(1)  in
     the command section of the manual.

     When  NMACS  is invoked by typing "nm file1", the file "file1" is
     loaded into memory and the first part is displayed.   If  "file1"
     does not exist, the screen is cleared and when the file is saved,
     it is first automatically created by the system.  When  the  file
     is  loaded  and the first 24 lines are displayed, there will be a
     line of reverse video at the bottom of the screen.  This line  is
     called  the  mode  line and is used to communicate with the user.
     Its initial display looks as shown

       0:file1							  <>

     where "0" designates the  buffer  number  (see  Buffer  Functions
     below)  and the two brackets "<>" are used to enclose the current
     search string (which starts out null).

     NMACS is always in insert mode at the  position  of  the  cursor;
     anything  typed will go into the edit buffer except for commands.
     Commands are normally invoked by  control  characters  or  escape
     sequences.  However, you can bind any command to any key sequence
     using the Key Map Compiler (see below).  The commands  and  their
     default  bindings  are  all  described below.  The control key is
     represented by "↑" and "↑X" means to hold the  control  key  down
     while typing "x".  (By convention control characters are shown as
     upper case,  but  they  are  actually  typed  lower  case.)   The
     commands  that are used most often are invoked by typing a single
     control character.  The less frequently used commands are  called
     by  first  typing  "↑X", which sets a toggle, followed by another
     ordinary character or control character.


     HELP

     Until  you  have  memorized  many  of  the  commands,  you   will
     frequently  need  to  consult  a  help  file to remind you of the
     commands.  Help is called by typing ↑Xh or PF2 (on  the  function
     keypad)  which causes the screen to display all the commands with
     a brief description of each.  To return to  insert  mode  in  the
     editor, retype ↑Xh or PF2.

     ↑Xh:  help toggle
     PF2:  help toggle









				  - 151 -





     Cursor Control

     Each window (see Window Functions below) marks a current position
     in its associated buffer with a reverse video character.  This is
     the  cursor position.  The most frequently used commands move the
     cursor around the screen.  NMACS generally arranges  the  display
     so  that the line with the cursor is in the middle of the window.
     Most of the command characters suggest their functions and should
     be fairly easy to remember.

     ↑A: the cursor moves to the beginning of the previous line
     ↑Z: the cursor moves to the beginning of the next line
     ↑W: the cursor moves to the previous character (West)
     ↑E: the cursor moves to the next character (East)
     ↑V: the cursor moves to the beginning of the line
     ↑G: the cursor moves to the end of the line
     ↑U: the cursor moves Up by the current window size
     ↑P: the cursor moves (Pages) down by the current window size
     ↑T: the cursor moves to the Top of the file
     ↑B: the cursor moves one position past the Bottom of the file
     ↑X↑T#: the cursor moves to character number # in the buffer
     ↑X↑N:  the cursor moves to the next window

     The arrow keys perform the equivalent functions of Up (↑A),
     Down (↑Z), Right (↑E) and Left (↑W).


     Deletion

     Since  you  are  automatically in insert mode, it is necessary to
     use commands to delete portions of text.  The delete commands are
     very simple and are listed below.

     ↑D:   delete the character under the cursor (holding down this
	   command deletes characters to the right of the cursor)
     ↑H:   delete the character to the left of the cursor (holding
	   down this command deletes characters to the left of the
	   cursor).  "delete" and "backspace" are the same as "↑H".
     ↑L:   delete from the cursor to the end of the line
     ↑K:   delete (kill) previously marked block (see Block Functions
	   below).

















				  - 152 -





     Search Functions

     It  is  often useful to search for a particular string.  In NMACS
     you first set up a new search string by typing  ↑N.   The  cursor
     goes to the mode line at the bottom of the screen.  You then type
     the string to be searched for (up  to  16  characters)  which  is
     displayed between the brackets.  The search function is sensitive
     to whether a letter is typed upper or  lower  case.   The  "enter
     string"  mode  is  terminated by typing ↑J or LF (linefeed) which
     terminates the ↑N command or,  more  likely,  ↑F  which  searches
     forward (or ESC which searches backward) through the file for the
     string.  If the string is found, the cursor stops  at  the  first
     character  after  the  string  in  forward search or at the first
     character of the string in backward search.  If the string is not
     found, a bell (↑G) is sent to the terminal and the cursor remains
     where it was.  ESC can only be used  for  backward  search  as  a
     terminator  of  the  search  string so if you want to continue to
     search backward, you must type ↑X↑F each time.   One  consequence
     of  the  search  characteristics  is  that  if you want to search
     forward and end just beyond the string, you type ↑F while if  you
     want  to end at the beginning of the string, you type ↑F↑X↑F.  (A
     search string can have ↑I (tab) and ↑M (<CR>)  while  ↑H  or  DEL
     will delete the previous character in the string.)

     ↑N:   set new search string (terminated by ↑F, ESC, ↑J or LF)
     ↑F:   search forward; stop at first character after string
     ESC:  exit string define mode and search backward
     ↑X↑F: search backward; stop at first character of string






























				  - 153 -





     Block Functions

     It  is  often  useful  to  operate  on  blocks or regions of text
     instead of single characters or lines.  NMACS has  functions  for
     marking  a  block, deleting it, copying it to the cursor position
     and copying it to a buffer  (see  Buffer  Functions  below).   In
     order  to  operate  on  a  region, it must first be marked.  Each
     window has two associated character positions, known as the start
     and  end  region  markers.   The  start  region  mark  is  set by
     positioning the cursor at the beginning of the  region  and  then
     typing ↑@ (↑spacebar).  To set the end region mark, the cursor is
     moved to the end of the region and ↑Y is typed.  This  marks  the
     block;  only  one  block  may be marked in each window at a time.
     After marking the block, it can be deleted by typing  ↑K  (kill).
     It can be copied by moving the cursor and typing ↑Xc which copies
     the text to the cursor  position.   To  "move"  a  block  to  the
     cursor,  type  ↑Xc↑K  after  first  positioning the cursor.  This
     first copies the  block  to  the  cursor  and  then  deletes  the
     original  block that was copied.  To copy the block into a buffer
     (the buffer must not be associated with a file or  the  operation
     will  be  refused),  type ↑X↑P# where # is the buffer number.  If
     the buffer is not empty, the block replaces whatever  was  there.

     ↑@:    mark beginning of block (↑spacebar)
     ↑Y:    mark end of block
     ↑K:    delete (kill) marked block
     ↑Xc:   copy marked block to cursor
     ↑X↑P#: copy (put) marked block in buffer #






























				  - 154 -





     Buffer Functions

     NMACS  maintains 16 buffers labelled 0 to F.  Buffer F is used to
     hold the help file and should not be used as an ordinary  buffer.
     When  NMACS is invoked by typing "nm filename", buffer 0 is named
     "filename" and is filled with the contents  of  filename.   Thus,
     the user has 14 other buffers to use for other files or temporary
     text.  A buffer can be initialized by moving a block from another
     buffer  or  by  moving  a named file into the buffer.  To "put" a
     block of text in a buffer, first mark the  block  and  then  type
     ↑X↑P#  where  #  is  the number of the buffer to be used.  If the
     buffer is not associated with a file but already  contains  data,
     its  contents will be overwritten with the new block.  To "get" a
     named file into a buffer, type ↑X↑G# where # is the number of the
     buffer  to  receive the file.  NMACS then reduces the size of the
     existing windows and displays a new window (see Window  Functions
     below)  with  a  new mode line and the cursor is positioned after
     the buffer label.  You then type the name of the file  terminated
     by  a  <cr>  and  NMACS  gets the file, puts it in the buffer and
     displays it.  There is a limit of four windows so if you want  to
     "get"  more than four files into buffers, you must "kill" display
     windows for some of the buffers.  The contents of a buffer can be
     copied  ("retrieved") to the cursor position in another buffer by
     first positioning the cursor and then typing ↑X↑R# where # is the
     buffer number from which the text is to be copied.  The status of
     the buffers can be discovered  by  typing  ↑Xb.   The  screen  is
     cleared  and  the status of each buffer is displayed one line per
     buffer.  An abbreviated example of a  buffer  status  display  is
     shown below.

     0: file   :M: xyz
     1: empty  : :
     2: text   : :
     3: file   : : abc

     This display means that buffer 0 has file "xyz" in it and that it
     has been modified.  (Actually, it is more accurate  to  say  that
     when buffer 0 is saved it will be saved in the file named "xyz".)
     Buffer 1 is empty; buffer 2 has a block of unmodified text in it,
     and unmodified file "abc" is in buffer 3.  The status display can
     be terminated by typing any key.

     Buffer F is used to hold the help file.  When  you  type  ↑Xh  or
     PF2,  Buffer  F  is  filled  with  the help file, all windows are
     removed and Buffer  F  alone  is  displayed.   You  may  use  the
     ordinary  NMACS  commands  to peruse the help file.  However, any
     changes you make will not be saved.  Buffer F  can  be  used  for
     data  but  this  is  a dangerous practice since any call for HELP
     (↑Xh) will wipe out whatever is there.

     ↑Xb:  display status of buffers (terminate by typing any key)
     ↑X↑P#:  put a marked block in buffer #
     ↑X↑G#:  get a file (whose name is a parameter) into buffer #
     ↑X↑R#:  retrieve a buffer to the current cursor position




				  - 155 -





     Window Functions

     Windows are used to display buffers for editing.   To  display  a
     buffer,  type  ↑X↑A#  which will "add" a window for buffer #.  If
     the buffer is empty or  there  are  already  four  windows  being
     displayed,  the  command  will  be  refused.   As stated above, a
     window is automatically created if you type  ↑X↑G#  in  order  to
     "get"  a  file  into  buffer #.  The current window (the "current
     window" is the one with the cursor) can be deleted ("killed")  by
     typing ↑X↑K.  The kill window command will be refused if there is
     only one window being displayed.  To save the current window  and
     resume,  type ↑Xs.  This should be done frequently and takes very
     little time or effort.  If the current  window  is  displaying  a
     named buffer, the name can be changed by typing ↑Xn.  This causes
     the cursor to go to the name on the  mode  line  of  the  current
     window.   To  change the name, delete the unwanted characters and
     type the new name followed by a <CR>.  All saves after this  will
     save the buffer in the file with the new name.  Typing ↑X↑N moves
     the cursor to the next window down.  When the current  window  is
     the bottom one, the cursor moves to the top window.

     ↑X↑A#: create (add) a window and display buffer #
     ↑X↑G#: copy (get) file into buffer #
     ↑X↑K:  kill current window
     ↑Xs:   save current window (if buffer is named)
     ↑Xn:   change name of buffer (if file) in current window
     ↑X↑N:  move cursor to next window


     Exit Functions

     The  simplest exit function is ↑J or ↑X↑J which is used to cancel
     the current command.  To quit NMACS without  saving  any  of  the
     buffers,  type  either  ↑ or  ↑X↑.  Typing either ↑] or ↑X↑] will
     save all named buffers.  Buffers  are  saved  exactly  as  typed;
     there  is no "end-of-line" added to the file.  The editor opens a
     file for only the time it takes to completely read or  write  the
     file.   When  an  existing  file  is  to  be written, it is first
     renamed to the same name with ".bak" appended.  If a  "bak"  file
     already exists, it is removed.

     ↑J:   cancel current command
     ↑X↑J: cancel current command
     ↑:	  exit NMACS without saving buffers
     ↑X↑: exit NMACS without saving buffers
     ↑]:   save buffers and exit NMACS
     ↑X↑]: save buffers and exit NMACS











				  - 156 -





     Command Repetition

     Commands  that are bound to single keys can be repeated by simply
     holding the key down.  Any command, including macros (see below),
     can  be  repeated  a specific number (#) of times by preceding it
     with ",#" where "," is on the function keypad.  The parameter, #,
     is  terminated  by  the  first  non-numeric  character.   If  the
     termination character is not a <CR>, it is  taken  as  the  first
     letter  of  the  next  command.  Command execution under a repeat
     count can be aborted by typing a ↑J or <LF>.

     ,#:  set repeat count to #
     ↑J:  cancel repeat
     LF:  cancel repeat


     Registers, Arguments and Macro Functions

     NMACS commands can be combined to form macro functions to perform
     difficult or repetitive tasks.  Ten key macros can be defined and
     each macro can be up to 256 characters long.   Although  a  macro
     cannot  define  another  macro,  it  can invoke one that has been
     previously  defined.   Ten  variables,  called   registers,   are
     provided   at   each  level  to  enhance  this  nested  execution
     capability.

     Registers can be used to store text or numbers, to pass arguments
     to  other  editor  commands or macros, or as counters.  Registers
     are addressed by a single digit, 0-9.  One  register  command  is
     load  register  (↑Xl#)  which  prompts for a general string value
     that is then loaded into register #.  If the string is a  number,
     the  register  is  marked as containing a numeric value.  This is
     also true if the string begins with ".", which is  taken  as  the
     character  position  of  the  cursor  in the current window.  The
     other register command is add registers (↑Xi).   If  the  current
     argument  list (see below) contains one parameter, its associated
     register is incremented.  If there are at  least  two  arguments,
     the  value in the register addressed by the first is added to the
     value in the register addressed by the second.  When a  macro  is
     invoked  either  from  the top level or from another macro, a new
     set of ten registers is created.  Thus, each macro  can  use  its
     registers  independently of any macros that it calls or that call
     it.















				  - 157 -





     However, sometimes a macro needs to access registers in an  outer
     level  of  execution.   Macro arguments provide this facility.  A
     macro may pass by reference up to ten arguments to a  macro  that
     it  calls.   An  argument may be one of the calling macro's local
     registers or one of the arguments that it was passed by the macro
     (or  top  level) that called it.  The arguments passed to a macro
     are used in a manner analogous to  the  way  it  uses  its  local
     registers.   They are addressed by a single digit, 0-9, but using
     different commands than those used  by  registers.   In  general,
     when  a  command  requires  a  parameter or a macro references an
     argument, an argument list  is  consulted  before  prompting  the
     user.   If  the argument list contains the address of a register,
     its contents are used as the parameter and its address is removed
     from the argument list.  An argument list is created by using the
     push register (↑Xr#) and push argument  (↑Xa#)  commands.   These
     commands  add  to the argument list the address of either a local
     register or a register that was passed as an argument.  These are
     the  only  commands  that distinguish between local and non-local
     registers and  are  sufficient  to  resolve  the  overloading  of
     register and argument addressing.

     A  macro  function  can  be  repeated  either  by  preceding  its
     invocation with a set repeat count command, or by causing  direct
     or  indirect  recursion.  In either case, conditional termination
     is often needed for such things as end-of-buffer or  unsuccessful
     search.    This   capability   is  provided  by  two  cooperating
     facilities.  First, all commands return a "true" or "false" value
     upon termination.  This value is related to its performance.  For
     example, the search commands return false when  their  search  is
     unsuccessful  and  cursor  movement  commands  return  false when
     end-of-buffer is reached.  The conditions under which  a  command
     returns  false  are  listed in the Command Summary section below.
     The second facility is provided by two commands,  macro  exit  OK
     (FK0)  and macro exit fail (FK1), that test the value returned by
     the previous  command  and  exit  the  macro  on  true  or  false
     respectively.    (FK  refers  to  the  function  keypad.)   These
     commands to conditionally exit a macro also terminate any  direct
     repetition of the macro resulting from a set repeat count command
     immediately prior to its invocation.  However, only one level  of
     execution  is terminated.  When a macro terminates normally or by
     conditional exit,  the  return  value  of  the  last  command  it
     executed becomes its return value to the next higher level.

     ↑X[:  define beginning of key macro
     ↑X]:  define end of key macro
     FK0:  exit macro if last returned condition value is true
     FK1:  exit macro is last returned condition value is false
     ↑Xl#: load register # (#=0,...,9)
     ↑Xi:  add registers (or increment if only one argument on list)
     ↑Xr#: push register # (put local register on argument list)
     ↑Xa#: push argument # (put passed value on argument list)
     ↑Xdm: display text of defined macros (used to save macros)
     ↑X#:  execute macro # (#=0,...,9)
     enter:  execute macro 0 (enter is on function key pad)




				  - 158 -





     Examples

     The  top  level  of  execution has ten registers that can be used
     without need for a macro.  For example, if you want to  mark  the
     current  position  of the cursor, move to a different area in the
     file and then return to the marked position, then you first  save
     the current position in register 0:

	      ↑Xl0.<CR>	 (load reg 0 with ".")

     Then  after  completing your other work, when you want to go back
     to the saved position, you type:

              ↑Xr0↑X↑T    (push  reg  0  then  use  it  with  move  to
     position)

     Using the same procedure, you can mark up to ten positions in any
     buffer for future reference.


     Miscellaneous Functions

     There are times when you are in the midst of an edit session  and
     you need to do something in the shell.  For example, you may need
     to get a file into a buffer but have forgotten its name.  You can
     pause the editor to get into the shell, use "ls" to find the file
     and then wake up the editor.  To pause the  NMACS  process,  type
     ↑Xp.  The screen will display

	  NMACS process #

     where # is the process number of the current edit session.  After
     using the shell, type "fg #" to wake up  the  NMACS  process  and
     continue editing.

     If  you  want  to keep the screen from being updated, you can use
     the suppress update command (↑Xo).  This command can be useful in
     a  complex macro to keep the screen from flashing and to make the
     macro run considerably faster.  Screen updating is  automatically
     enabled  when  exiting  a  macro where ↑Xo was used.  The refresh
     screen command (↑R) redraws the screen and if screen  suppression
     is in effect, screen updating is enabled.

     The  insert  line command (↑X↑L) inserts a newline (linefeed) and
     repositions the cursor on it.  The insert argument command (↑X↑I)
     inserts  a string parameter at the cursor position.  This is very
     useful in macros to access strings sent as arguments.

     ↑Xp:  pause the current edit process (resume with "fg #")
     ↑Xo:  suppress screen update
     ↑R:   refresh the screen and enable screen updating
     ↑X↑L: insert <LF> (linefeed)
     ↑X↑I: insert argument





				  - 159 -





     Command Mapping

     NMACS allows you to redefine the key sequences that are bound to
     the commands.  This is called "key mapping" and a new binding is
     invoked by using the "-k" option followed by a new keymap file.
	 A
     keymap file is the output of the keymap compiler which takes a
	 keymap
     specification as input.  If no keymap is specified, NMACS
	 searches
     the current directory and then "/sys" for a keymap file named
     "keymap.nm".  If this keymap
     file or a specified keymap file cannot be read and interpreted
     successfully, a built-in keymap is used with the default bindings
     defined in this document.	However, in this case the information
     needed for the help command will not be available.

     Each line of the keymap specification file binds a command to one
     or more keys, (a key sequence).  An exception is a line
     beginning with "#" which is treated as a comment.	Otherwise the
     syntax of a line is:

      <binding>	 ::= "'" <sequence> "'" [ <range-end> ] <command-name>
      <sequence> ::= <sequence> <key> | <key>
      <range-end>::= "-" "'" <key> "'"
      <key>	 ::= "↑" <printable-char> | <printable-char> | "↑" |
			   "e" | "'" | "r" | "\"
      <printable-char>::= any ASCII character, except "'", between
			   space and tilde inclusive
      <command-name>  ::= the name of an NMACS command

     In the usual case, a binding  will  consist  of  a  key  sequence
     enclosed in apostrophes followed by the name of the command to be
     bound to that sequence.  For example:

		'↑E'	nextChar






















				  - 160 -





     Command names must appear exactly as given in the Command Summary
     below  which is a valid keymap specification file.  Characters in
     a key sequence are  generally  taken  as  they  appear  with  the
     following exceptions:

	   ↑X = control x for any x
	   e = escape (same as ↑[)
	   r = rubout (or delete)
	   ↑ = ↑
	   ' = '
	   \ = .sp 1
     A  range  of  key sequences may also be bound to a command.  This
     feature is generally used to bind the printable characters:

	   ' '-'?'    insertSelf
	   '@'-'←'    insertSelf
	   '`'-'r'   insertSelf

     Note that only one quadrant of the ASCII character set may appear
     in a single binding.






































				  - 161 -





     The keymap compiler, "kc", is invoked as shown:

	   kc keymapspec [-o keymapfile]

     where  keymapspec  is  the name of the keymap specification file,
     and keymapfile is the name of the resulting keymap file.  If  the
     "-o"  option  is  not  used,  the  output  keymap  file  is named
     "kc.out".  Care should be taken not to invoke NMACS with a keymap
     that does not include a binding for exit commands.


     Command Summary

     The  NMACS  commands  are summarized here with their exact names,
     their default bindings and some comments including the conditions
     under  which  the  command returns false.   The key sequences for
     invoking  the  commands  are  enclosed  in  apostrophes.     ("↑"
     preceding  a  key  refers to holding down the control key,  while
     "E"  refers to an escape  sequence which  is  usually  invoked on
     the function  keypad.)

     Key     Name		     Description

     '↑@'    regionStart
     #
     #set start-of-region marker; always true
     #
     '↑A'    prevLine
     #
     #move cursor to start of previous line; false if on first line
     #
     '↑B'    endBuffer
     #
     #move cursor to end of buffer; false if buffer empty
     #
     '↑D'    deleteChar
     #
     #delete the character the cursor is on; false if at or beyond
     #the last character in the buffer
     #
     '↑E'    nextChar
     #
     #move cursor to the next character; false if at or beyond the
     #last character in the buffer
     #
     '↑F'    searchForward
     #
     #search forward; false if search string null or search fails
     #
     '↑G'    endLine
     #
     #move cursor to end of current line; false if no newline is
     #found at or beyond cursor





				  - 162 -





     '↑H'    deletePrevChar
     #
     #delete the character before the cursor; false if no character
     #is before the cursor
     #
     '↑I'    insertSelf
     #
     #insert current character at cursor; false if insertion would
     #extend the line beyond the editor's maximum line length (256)
     #
     '↑J'    abortCommand
     #
     #cancel current command; always false
     #
     '↑K'    deleteRegion
     #
     #delete region between start and end markers; false if markers
     #are not set
     #
     '↑L'    deleteLine
     #
     #delete through end of current line; false if there is no
     #newline character at or beyond the cursor
     #
     '↑M'    insertSelf
     #
     #insert current character at cursor; false if insertion would
     #extend line beyond the editor's maximum line length (256)
     #
     '↑N'    setSearchString
     #
     #set search string for current window; false if a search is
     #initiated and it fails
     #
     '↑P'    nextPage
     #
     #move cursor forward window size lines; false if end-of-buffer
     #is encountered
     #
     '↑Q'    abortCommand
     #
     #cancel current command; always false
     #
     '↑R'    refreshScreen
     #
     #redraw screen; always true
     #
     '↑S'    abortCommand
     #
     #cancel current command; always false
     #
     '↑T'    startBuffer
     #
     #move cursor to beginning of buffer; false if buffer is empty




				  - 163 -





     '↑U'    prevPage
     #
     #move cursor backward window size lines; false if
     #start-of-buffer is encountered
     #
     '↑V'    startLine
     #
     #move cursor to beginning of current line; false if buffer empty
     #
     '↑W'    prevChar
     #
     #move cursor backward one character; false if at start of buffer
     #
     '↑X↑A'  addWindow
     #
     #add a window to the display for a specified buffer; false if
     #there are already four windows or if buffer is empty
     #
     '↑X↑D'  deleteWord
     #
     #delete word or white space under cursor (Not Yet Implemented)
     #
     '↑X↑F'  searchBackward
     #
     #search backward; false if search fails or search string is null
     #
     '↑X↑G'  editFile
     #
     #edit a specified file in a specified buffer; false if buffer is
     #not empty or if filename string is null
     #
     '↑X↑H'  abortCommand
     #
     #cancel current command; always false
     #
     '↑X↑I'  insertArg
     #
     #insert argument string into buffer; false if string is null
     #
     '↑X↑J'  abortCommand
     #
     #cancel current command; always false
     #
     '↑X↑K'  killWindow
     #
     #remove current window from display; false if only one window
     #
     '↑X↑L'  insertLine
     #
     #start a new line before the current position; always true
     #
     '↑X↑N'  nextWindow
     #
     #move cursor to next window on display; false if only one window




				  - 164 -





     '↑X↑P'  copyRegionToBuffer
     #
     #copy current region to a specified buffer; false if buffer is
     #associated with a file or if markers are not set
     #
     '↑X↑R'  copyBuffer
     #
     #copy contents of specified buffer to current position; false if
     #buffer is empty
     #
     '↑X↑T'  setPosition
     #
     #move cursor to specified character position; false if the
     #character position is after the last character in buffer
     #
     '↑X↑U'  undo
     #
     #undo last command if possible (Not Yet Implemented)
     #
     '↑X↑X'  abortCommand
     #
     #cancel current command; always true
     #
     '↑X↑Z'  saveAndExit
     #
     #write modified file buffers and exit editor; no return
     #
     '↑X↑'  exitNoSave
     #
     #exit editor without writing file(s); no return
     #
     '↑X↑]'  saveAndExit
     #
     #write modified file buffers and exit editor; no return
     #
     '↑X9'   macroExecute
     #
     #execute the current key macro command; the returned value
     #is that returned by the last command executed in the macro
     #
     '↑X8'   macroExecute
     '↑X7'   macroExecute
     '↑X6'   macroExecute
     '↑X5'   macroExecute
     '↑X4'   macroExecute
     '↑X3'   macroExecute
     '↑X2'   macroExecute
     '↑X1'   macroExecute
     '↑X0'   macroExecute
     #
     '↑X]'   macroEnd
     #
     #end definition of the key macro command; false if a macro
     #definition is not active




				  - 165 -





     '↑X['   macroBegin
     #
     #begin definition of the key macro command; always true
     #
     '↑Xa9'  pushArg
     #
     #push an argument of the current level; false if the
     #argument is null
     #
     '↑Xa8'  pushArg
     '↑Xa7'  pushArg
     '↑Xa6'  pushArg
     '↑Xa5'  pushArg
     '↑Xa4'  pushArg
     '↑Xa3'  pushArg
     '↑Xa2'  pushArg
     '↑Xa1'  pushArg
     '↑Xa0'  pushArg
     #
     '↑Xb'   listBuffers
     #
     #list buffer status; always true
     #
     '↑Xc'   copyRegion
     #
     #insert contents of current region before cursor; false if
     #the region markers are not set
     #
     '↑Xdm'  macroDisplay
     #
     #insert key macro text in current buffer; always true
     #
     '↑Xh'   help
     #
     #enter editor help mode; false if last keymap file specified
     #was not read successfully
     #
     '↑Xi'   addReg
     #
     #add argument values; false if the argument list is empty or the
     #specified registers are not marked as numeric
     #
     '↑Xl9'  loadReg
     #
     #load a value into a register; always true
     #
     '↑Xl8'  loadReg
     '↑Xl7'  loadReg
     '↑Xl6'  loadReg
     '↑Xl5'  loadReg
     '↑Xl4'  loadReg
     '↑Xl3'  loadReg
     '↑Xl2'  loadReg
     '↑Xl1'  loadReg
     '↑Xl0'  loadReg



				  - 166 -





     '↑Xn'   setFileName
     #
     #set default filename for current buffer; false if buffer has
     #a null filename or if the specified filename is null
     #
     '↑Xo'   suppressUpdate
     #
     #suppress display update; always true
     #
     '↑Xp'   pauseEdit
     #
     #suspend editor; always true
     #
     '↑Xr9'  pushReg
     #
     #push a register as an argument; always true
     #
     '↑Xr8'  pushReg
     '↑Xr7'  pushReg
     '↑Xr6'  pushReg
     '↑Xr5'  pushReg
     '↑Xr4'  pushReg
     '↑Xr3'  pushReg
     '↑Xr2'  pushReg
     '↑Xr1'  pushReg
     '↑Xr0'  pushReg
































				  - 167 -





     '↑Xs'   writeDefaultFile
     #
     #write current buffer to default filename; false if buffer has
     #null filename or if buffer has not been modified
     #
     '↑Y'    regionEnd
     #
     #set end-of-region marker; always true
     #
     '↑Z'    nextLine
     #
     #move cursor to beginning of next line; false if on last line
     #
     'E[D'  prevChar
     #
     #move cursor backward one character; false if at start of buffer
     #
     'E[C'  nextChar
     #
     #move cursor to the next character; false if at or beyond last
     #character
     #
     'E[B'  nextLine
     #
     #move cursor to beginning of next line; false if on last line
     #
     'E[A'  prevLine
     #
     #move to beginning of previous line; false if on first line





























				  - 168 -





     'EOS'  newKeymap
     #
     #read a new keymap from a file (Not Yet Implemented) (PF1)
     #
     'EOQ'  help
     #
     #enter editor help mode; false if last keymap file specified was
     #not read successfully (PF2)
     #
     'EOP'  doCommand
     #
     #execute a command by name (Not Yet Implemented) (PF3)
     #
     'EOM'  macroZero
     #
     #execute key macro zero; the returned value is that returned by
     #the last command executed in the macro (ENTER)
     #
     'EOq'  macroExitFail
     #
     #exit a key macro if last command failed; false if invoked from
     #the keyboard (FK1)
     #
     'EOp'  macroExitOK
     #
     #exit a key macro if last command succeeded; false if invoked
     #from the keyboard (FK0)
     #
     'EOl'  setRepeatCount
     #
     #set repeat count for next command; always true (FK,)
     #
     '↑'    exitNoSave
     #
     #exit editor without writing file(s); no return
     #
     '↑]'    saveAndExit
     #
     #write modified file buffers and exit editor; no return
     #
     '↑↑'    copyRegion
     #
     #insert contents of current region before cursor; false if
     #region markers are not set
     #
     ' '-'?' insertSelf
     #
     #insert current character at cursor; false if insertion would
     #extend the line beyond the editor's maximum line length (256)
     #
     '@'-'←' insertSelf
     '`'-'r' insertSelf






				  - 169 -





     5.3.1.3  Memory Management

     The NCUBE system provides a segmented virtual memory environment.
     The virtual address space is 2**30 bytes.  Main memory is treated
     as  a  set  of segments on 256 byte  boundaries.   The  operating
     system provides allocation, deallocation, extension (segments can
     grow  to  64 Kbytes),  compaction and  swapping  functions.   The
     system  relies  on the Intel 80286  memory  management  hardware.
     Memory  is allocated and deallocated with the system call  "core"
     (see 5.3.2.2).
















































				  - 170 -





     5.3.1.4  Process Management

     Processes are managed by the operating system as the  fundamental
     units of computation.   They are created,  scheduled,  dispatched
     and  killed  by the system in a uniform way  for  all  processes.
     When the operating system is booted the primary, highest priority
     system  process,  called  the MCP (Master  Control  Program),  is
     dispatched.   It  initializes  the system  including  dispatching
     background system processess (like a print spooler) that it  gets
     from a system initialization file,  watches terminals and creates
     processes.   It  also  cleans up and shuts down the  system  when
     power failure or overheating is detected.

     Whenever  a user logs on the system,  the MCP checks his name and
     password.   If  he  is  an authorized user and  the  password  is
     correct,  the MCP creates a process for him.   The parameters  of
     the  process are taken from his account file that is  created  by
     the system administrator.  These parameters include the priority,
     the initial program (usually the shell), the preface (user's root
     directory) and billing information.  The account file for "user1"
     is  named /sys/acct/user1.   For detailed specifications of files
     in /sys/acct see 5.3.2.4.

     A  process is represented by a data structure  in  memory.   This
     structure,  called  a process object,  has the following  entries
     (for details see 5.3.2.5)

	  state:  This is the area where register values including
		  segment pointers are saved when the process is
		  not executing.

	  condition:  The conditions that a process can be in are
			   runnable
			   waiting for memory allocation
			   waiting for array allocation
			   waiting for a message
			   waiting for error handling
			   etc

	  code and data:  These entries point to the code and data
			  for the process program.

	  preface:  This is the name of the root directory of the
		    process.

	  directory:  This is the name of the current working
		      directory

	  priority:   A number between 0 and 255 indicating the
		      relative priority of the process (255 is the
		      highest priority).







				  - 171 -





	  time:	 The maximum number of clock ticks this process can
		 run before it must be rescheduled.

	  rights:  A process can be granted (1) or denied (0)
		   various rights according to the setting of the
		   flags listed below
			 create links
			 delete links
			 create processes
			 kill processes
			 superuser

	  owner:  Name of the user who created the process.

	  open files:  This is a table of descriptors for each or
		       the open files of the process.  When a
		       process is created the first three entries
		       (channel numbers 0,1 and 2) are initialized
		       to the following
			   0:  standard input file
			   1:  standard output file
			   2:  standard error file


     When a new process is created, its owner, priority and rights are
     either initialized by the account file or are inherited from  the
     creating  process.   The  priority and rights can be  reduced  or
     restricted but not increased or expanded.

     All  processes in the system are linked together in  the  process
     list.  When  it  is  time to dispatch a new process the  list  is
     searched  starting  from  the  process  that  was  most  recently
     running.   The  search finds and dispatches the highest  priority
     process that is in runnable condition.  If there is more than one
     the last one found is dispatched.   The process runs until one of
     three events occurs:

	       1) the process time slice is exhausted
	       2) the process must wait for some event such as a
		  message or disk operation
	       3) another higher priority process becomes runnable.

     Thus,   the  process  management  system  implements  preemptive,
     priority, round robin scheduling.

     There  are  a set of operations for  process  management.   These
     system  calls  are listed below (detailed specifications  are  in
     section 5.3.2.2)










				  - 172 -






			 Process System Calls




     frun: run a file

     getpcs: get priority, rights, time, condition, owner, etc

     chprot: change protection or rights

     alarm: set process alarm clock

     endpcs: terminate a process

     endump: terminate and dump

     pause: suspend a process

     psend: send a message or signal

     vector: set interrupt vector



































				  - 173 -





     5.3.1.5  Device Management

     The NCUBE system treats almost all resources as devices which are
     simply a special type of file.   The devices include disk drives,
     tape drives,  printers,  graphics hardware,  interboard bus,  SBX
     interfaces  and the hypercube array.   Devices are managed as are
     other files with open,  close, read and write calls.  For special
     operations  that  do not fall easily  in  those  categories,  the
     operating  system  supports a "special  operation"  call.   These
     special operations are things such as setting terminal parameters
     and  printer fonts.   The detailed specifications for the  device
     files  and  system  calls are in sections  5.3.2.5  and  5.3.2.2.
     However,  we  will give an overview below of the devices that are
     unique to the NCUBE system.












































				  - 174 -





     5.3.1.5.1	Hypercube Array

     The  NCUBE  system treats the hypercube array as  a  device  type
     file.   Consequently,  it  is  allocated with an "open"  command,
     deallocated with "close" and messages are sent and received  with
     "write" and "read" respectively.  One of the powerful features of
     the hypercube is that it is defined inductively and so all orders
     of  cube are logically equivalent.   When allocation is requested
     the  user specifies in the "open" call the subcube order  (N)  he
     needs.    If  a  subcube  of  that  order  is  available,  it  is
     initialized  and  the nodes are numbered from 0 to  2**N-1.   The
     subcube  is  allocated  as close as possible  to  the  Host Board
     that  the  user's terminal is connected  to.   If  no subcube  of
     that  size is available,  the "open" returns an  error condition.
     This allows the user to either wait for a subcube of order  N  to
     become  available  or to request a smaller  one.   Once allocated
     the user owns the subcube until his process   terminates  or   he
     explicitly   deallocates  (closes)  it.    A  degree   of   fault
     tolerance  is achieved in the NCUBE system because the  operating
     system  periodically runs diagnostics on the Hypercube Array  and
     if  a node fails,  it is mapped out of the allocatable  resource.
     However, the rest of the nodes are available for use.  (A faulted
     node also causes the LED attached to its Array board to be turned
     off indicating a condition requiring service.)

     Special  operations  are defined for debugging  programs  on  the
     Array nodes.

     For more details on hypercube management see section 5.4.





























				  - 175 -





     5.3.1.5.2	Graphics System

     The  graphics  boards  are also treated as device files  and  are
     allocated and managed by each user with file system  calls.   The
     special  operations that are defined for the graphics devices are
     the graphics operations that the hardware itself supports such as
     line and circle drawing, fill-in, panning, etc.



















































				  - 176 -





     5.3.1.5.3	SBX Interface

     Each Host Board in an NCUBE  system  has  three  SBX  connectors.
     One   is  used for the cartridge tape controller  and another  is
     dedicated to providing the Interboard  Bus  (a  bus   for  moving
     data   between   Host  Boards).    The   last   SBX connector  is
     available  for custom parallel  I/O   applications.   There   are
     many potential uses for the SBX  Interface  including networking,
     9 track tape drive controller,  etc.   Regardless of what  it  is
     used  for,   it  will  be treated as a  device  by  the operating
     system.   Consequently,   it  is  only  necessary  to  write  the
     appropriate  device  driver  in  order  to use the standard  file
     system calls for device management.  Two  example  SBX  interface
     definitions are given below.

     Tape Controller SBX Interface

		  I/O Map

      0:   Data Read/Write (16 bit)
      2:*  Specify Data Read Transfer from Tape Unit
      4:*  Specify Command Write to Tape Unit
      6:*  Specify Data Write Transfer to Tape Unit
      8:   Read Status
	      Bit 0:  Attention; 1=true
	      Bit 1:  Input/Output; 1=output to tape
	      Bit 2:  Command/Data; 1=command
	      Bit 3:  Ready; 1=true
	      Bit 4:  Data Request; 1=true
	      Bits 4-15:  Undefined

	   Write Reset to Tape Unit; (Data does not matter)
	      This command must be followed by an End Transfer
	      command (I/O address A) a minimum of 10 usec later.
	      It only resets the Tape Unit; the command does not
	      reset the controller board.
      A:*  End Current Transfer
      C:*  Enable Data Request Interrupt (Low Byte, MCS0)
      D:*  Enable Data Request DMA (High Byte, MCS1)
	      A word write to address C performs both of the
	      above functions.
      E:*  Disable Data Request Interrupt (Low Byte, MCS0)
	      On power up, the interrupt comes up disabled.
      F:*  Disable Data Request DMA (High Byte, MCS1)
	      On power up, the data request comes up disabled.
     Note:  a minimum of 1 usec must elapse between an "End
	    Current Transfer" command and a "Specify Data Read".
	    (*=a write only register; the data does not matter)










				  - 177 -





     Interboard Bus SBX Interface

	   I/O Map (all transfers are word (16 bit) only)

      0: Write Slot ID
	   bits 0,1,2:	Slot Number
	   Bits 3-15:	Do not matter
	 Read Slot ID and Source Slot Number
	   Bits 0,1,2:	Slot Number Readback
	   Bit 3:  1=Slot Number Valid; 0=SBX Board Uninitialized
	   Bits 8,9,l0:	 Source Slot Number
	   Bit 11:  1=Source Slot Number Valid; 0=Invalid
	   Bits 4-7,12-15:  Undefined

      2: Write Destination Slot Number and Request Bus
	   Bits 0,1,2:	Destination Slot Number
	   Bits 3-15:  Do not matter
	 Read Destination Slot Number
	   Bits 0,1,2:	Destination Slot Readback
	   Bits 3-15:  Undefined

      3: Write Control
	   Bit 0: 1=Clear Arbitration Interrupt (Source)
	   Bit 1: 1=Clear Attention Interrupt (Destination)
	   Bit 2: 1=Clear Transfer Complete Interrupt and Status Bit
		    (Destination)
	   Bit 3: 1=Reset Parity Error Status Bit
	   Bit 4: 1=Reset Arbitration Error Interrupt and Status Bit
		    (Source)
	   Bit 5: 1=Release Bus
	   Bit 6: 1=Reset Bus
	   Bits 7-15: Reserved
	 Read Status
	   Bit 0: 1=Bus Obtained-Source Selected (generates interrupt)
	   Bit 1: 1=Attention-Destination Selected (generates
		    interrupt)
	   Bit 2: 1=Transfer Complete-Source has released bus
		    (generates interrupt)
	   Bit 3: 1=Parity Error
	   Bit 4: 1=Arbitration Error (generates interrupt; occurs on
		    source only and is caused by specifying Dest=Src,
		    Dest that does not exit or Data Transfer timeout)
	   Bit 5: 1=Board initialized; 0=Board uninitialized
	   Bits 6-15: Undefined

      6: Write Data (also DMA transfer)
	 Read Data (also DMA transfer; if source, readback of last
		    data written)










				  - 178 -





     5.3.1.6  Protection

     The AXIS system provides protection at several  levels.   At  the
     highest  level there is the standard password type of protection.
     The  user  is  assigned a name and  password  for  accessing  the
     system.   When  he logs on he is asked for his name and password.
     The  system makes sure the name and password are  correct  before
     allowing the user access to the machine.

     The  next level of protection is provided by the preface  in  the
     user account file.   The preface is a pathname that is implicitly
     attached  to all user supplied pathnames.   Thus,  a user has  no
     access  to files above or outside of his own hierarchy unless  he
     is  given  a link.   In this area AXIS differs  from  UNIX  where
     "/" refers to the system root and any user can access any file if
     he knows its pathname.

     In  addition  to the preface there is  an  additional  protection
     facility.   Every  component  in a pathname has a set  of  rights
     associated  with it.   In order to access a file in a  particular
     way,  that  right  must be granted by every name in the  pathname
     used to refer to the file.   This is a very powerful and  uniform
     facility  for  protecting  shared files.   Users can  be  granted
     access  to files that they do not own by being given links.   The
     creator  of  the  links  can grant or  deny  specific  rights  to
     particular   users  as  he  pleases.    See  the  definition   of
     directories, DIR(5) in section 5.3.2.5, for details on the access
     rights in pathname components.

     Besides the preface,  every account file has a set of rights that
     are  granted  or  denied.   These include  creating  and  killing
     processes,  creating and deleting links,  etc.   These rights can
     not be expanded by the user and restrict the ways he can use  the
     system.  For a detailed list of the rights see section 5.3.2.5 in
     the specification of the process object format.

     Finally,  the 80286 has four levels of protection built into  the
     hardware.   The AXIS system uses  only  the  highest  and  lowest
     levels   to   implement   a   familiar  User/Supervisor  type  of
     protection.   All user  programs run under user mode and can only
     access   operating  system  facilities through the defined system
     calls.
















				  - 179 -





     5.3.1.7  Statistics and Billing

     The  operating system collects statistics for each user  and  for
     the  system  itself.   These statistics can be used  for  billing
     purposes  if  desired or simply for information on system  usage.
     The system statistics include

	       total system up time
	       system crash count
	       idle time
	       start of up time
	       system overhead
	       array use time (number of nodes * seconds)
	       ECC error count (corrected)
	       unknown interrupts encountered (if this is ever
		    nonzero it should be reported immediately
		    to NCUBE)

     For details see the definition of the SYSDATA file in 5.3.2.5.

     The  statistics  collected  for each process are  stored  in  the
     process object (see PROCOBJ(5) in 5.3.2.5) and include

	       process start time
	       cpu time
	       memory size
	       start time of current memory size
	       kilo-core-seconds (the time integral of memory use)
	       disk reads (number of sectors)
	       disk writes (number of sectors)
	       other I/O count (in bytes; e.g. terminals)



























				  - 180 -





     5.3.1.8  Initialization

     The first level initialization is accomplished by simply  turning
     on	 the  system in Normal mode.   When the	 operating  system  is
     booted, it looks for a configuration file called

	       /sys/startup

     If the "startup" file exits, a shell is created that runs it as a
     command file.  One example of a command that would very likely be
     found in the startup file is

	       /sys/bin/spool > /sys/spool.log &

     which  causes the print spooler to be run as a  parallel  process
     (see  SH(1) in section 5.3.2.1 for an explanation of the syntax).

     In  addition,  the  system  administrator  must  perform  certain
     functions  such  as creating account files  for  each  user  (see
     chapter 6).

     After a user has an account, if he creates a file called  "login"
     in  his  logon  directory  it will be run  by  the  shell  as  an
     initialization sequence whenever he logs on the system.

     In  addition to initializing the operating system,  the hypercube
     array  must  be initialized.   The initialization  of  individual
     processors is discussed in section 4.9.   In this section we will
     present a method for initializing the system.   The main issue is
     how  to  propagate the initializing software through  the  array.
     There  is  more  than one acceptable algorithm  but  the  one  we
     present  here  is a very simple one with  high  efficiency.   The
     algorithm  is  based on a tree structure and can be  more  easily
     illustrated   than  described.    The  diagram  below  shows  the
     initialization responsibility for each processor assuming we have
     16 processors.  The binary numbers are the processor ID's and the
     decimal   numbers   represent   the  stage   in   time   of   the
     initialization.


	|-------|------------|----------------------------|------0000
	|5	|4	     |3				  |2
      0001  |--0010 |----|--0100  |------|------------|--1000
	   5|	   5|	 |4	 5|	 |4	      |3
	 0011	 0101 |--0110  1001 |--1010 |-----|--1100
		      |5	    |5	   5|	  |4
		     0111	  1011	 1101 |--1110
					     5|
					    1111









				  - 181 -





     The  assembly  language  code  fragment  that  illustrates   this
     algorithm is listed below.

	       MOVW  ID,R1   ;ID is memory location containing the
			     ;processor ID
	       LDPR  R1,PI   ;the ID is loaded into the ID processor
			     ;register
	       FFOW  R1,R2   ;R2 = # of trailing zeros in ID
	       SUBB  #1,R2   ;
	       BL    END     ;no trailing zeros => this processor is
			     ;a leaf on the graph
       LOOP:   MOVW  #1,R3   ;compute ID of neighbor by complementing
	       SFTW  R2,R3   ;one of the trailing zeros
	       MOVW  R1,R4   ;
	       XORW  R3,R4   ;R4 = new ID
	  ;{send message length to port #(R2)}
	  ;{receive status; use timeout}
	  ;	a. dead (timed out)
	  ;	b. failed self test
	  ;	c. parity error
	  ;	d. alive and well
	  ;{if alive MOVW  R4,ID;put new ID in memory}
	  ;{send copy of code and new ID to port #R2}
	       REP   R2	     ;
	       JMP   LOOP    ;
     END:
	  ;{look for responses and EROF}































				  - 182 -





     5.3.1.9  Shutdown

     The  system  will  shut itself down automatically if  it  detects
     power  failure or heat build up.   It saves some system state  so
     that  a  certain  level  of  recovery  is  possible.    Also  the
     administrator  can shut the system down by sending a  message  to
     all  terminals and after a decent interval,  invoking the  system
     call  "syshut" (see SYSHUT(2) in section 5.3.2.2) or the  command
     "shut"  (see  SHUT(1)  in section 5.3.2.1).   See chapter  6  for
     details on system shutdown.
















































				  - 183 -





     5.3.1.10  The Shell

     Shell Notes:

     In  order  to log on the system,  you must type  "↑C"  (sometimes
     several times) to get the logon message.  After the logon message
     is displayed,  you type your username followed by your  password.
     Then if your "initial program" is the shell (usually the case), a
     shell  will be started for you and you will get the shell  prompt
     which is ".".

     An  example  of a shell script is given below.   Create the  file
     "ascmd" with the text

	  as ↑1/src -e /bin/↑1 > ↑1/list

     Then, assuming "ascmd" is in the current PATH, when you type

	  ascmd filename

     "filename/src" will be assembled, its object will be stored in

	  /bin/filename

     and its listing will be stored in

	  filename/list



     An  example  of  how to use the "fg" (foreground) command  is  as
     follows.  Suppose you are editing and you want to do something in
     the shell.  You suspend the editor (type "↑Xp") which puts you in
     the shell where you can type commands.  Then by typing

	  fg #

     where  #  is  the process number of the  edit  process  that  was
     suspended, the shell process is suspended and the edit process is
     awakened.

     "eval"  allows you to create an environment for the shell you are
     currently  in since it treats a file as if it had been  typed  at
     the terminal.

     "bg"  is the same as "kill -wake".   An example of its use is  to
     wake  up  a  task that is stopped for debug or a  task  that  was
     "paused" because it was taking up too much CPU time.










				  - 184 -





     5.3.2  Operating System Programmer's Manual

     This section is modelled on the UNIX Programmer's Manual,  Volume
     1.   Since  the  NCUBE system is very close to UNIX at  the  user
     interface  level,  we believe it helpful to use a familiar format
     for the detailed documentation.   The notation in these  sections
     also corresponds to the UNIX manual:

		    [ ]	 means	"optional"
		    ...	 means	"one or more of the named type"

      Definitions:

	     filename
	     directory
	     pathname
	     path
	     exefile








































				  - 185 -





     5.3.2.1  Commands

     This  section specifies the commands in alphabetic order that are
     implemented in the NCUBE system.

     All  of the commands listed below are intended to be  implemented
     in the AXIS system; the (*) commands will be added later.

	ADB:	debugger		SLEEP: suspend process
	AS:	assembler (80286)     * SORT:  sort or merge
	ASN:	assembler (NCUBE)     * SPLIT: split a file
      * AT:	later execution		STTY:  set terminal
      * BAS:	Basic			TAIL:  display end of a file
	CAT:	catenate and print	TBR:   tape backup/restore
	CD:	change directory	TEE:   pipe with file save
	CHFIL:	change file type      * WAIT:  wait for completion
	CHMOD:	change protection	WALL:  write to all users
	CMP:	file compare		WHO:   display system users
	CN:	change name		WRITE: send text
	CP:	copy
	DATE:	print date
	DF:	disk free space
      * DIFF:	diff. file compare
      * DU:	disk usage
	ECHO:	echo arguments
      * ED:	line editor
	ET:	terminal emulation
	F77:	Fortran 77
      * GREP:	pattern search
	HELP:	help
	HD:	hex dump
	KILL:	kill process
	LN:	make a link
	LOGOUT: log off system
	LS:	list directory
      * MAIL:	local mail
	MAN:	print manual
	MESG:	messages (yes/no)
	MORE:	paged display
	MOUNT:	mount file system
	MV:	move file or tree
	NM:	screen editor (NMACS)
	NSH:	shell (see SH)
	PASSWD: change password
	PR:	print file
	PS:	process status
	PSTAT:	system status
	PWD:	working directory
	RM:	remove file
	RMLN:	remove link
      * SA:	system accounting
      * SED:	stream editor
	SH:	shell
	SHUT:	invoke RAM Monitor




				  - 186 -





     ADB(1)						    ADB(1)


     NAME

     adb -- debugger


     SYNOPSIS

     adb [exefile [args]] or [-p process number]


     DESCRIPTION

     "adb" is a general purpose debugger useful for executing programs
     in  a  controlled  environment and  interactively  examining  the
     results.  One of the operands must be given.  In order to use the
     second operand form, you may need first to type the PS(1) command
     which will list the ID numbers of the active processes.  In order
     to debug an active process, you should either have put an "int3;"
     (breakpoint) in the code and wait for it to reach that state;  or
     you  should  type  "kill -p #"  to  "pause"  the  process.    The
     functions that are supported are listed below.   The commands are
     invoked by typing the first letter of the command name.   Since a
     working segment is understood, <ADDR> below is only an offset.

     "adb" has two modes that are indicated by the prompt.  When "adb"
     is invoked, it is in Host (80286) mode and the prompt is  "286>".
     The  Host mode is for debugging Host programs.   However,  one of
     the  commands in Host mode is "Node mode".   Invoking  node  mode
     causes  "adb" to display the prompt  "node 0>"  since the default
     selected  node  is  node 0.   The  node  mode is  used  to  debug
     programs  on individual nodes.   The commands for both modes  are
     listed below.


     HOST MODE ("286>")

     287 registers

	  The contents of the 80287 registers are displayed.


     breakpoint {<ADDR>| label <LABEL>}

	  In the first option, a breakpoint is set at location ADDR.
	  The code segment is understood and ADDR should be the
	  location of an instruction.  Only one breakpoint can be
	  active at a time (the last one entered is active).  When the
	  breakpoint is encountered, the debugger prompt ("+") is
	  displayed.  The second option is invoked by typing "bl"
	  followed by one of the recognized program labels.  The "load
	  symbol table" command must have been executed first.	The
	  "variables" command displays the recognized labels.



				  - 187 -





     ADB(1)							ADB(1)


     change registers <REG>

	  The value contained in register REG is displayed.  The user
	  may change it by typing a new value.	Typing a <LF> causes
	  the command to be repeated for the next register in the
	  sequence (see REG in 5.2.4).	A <CR> terminates the
	  command.


     display {<ADDR>,<LENGTH>| var <VARIABLE>...}

	  In the first option, memory from ADDR to ADDR+LENGTH-1 is
	  displayed in the same format as "ascii dump" in the Monitor
	  (see 5.2.4.1).  The second option is invoked by typing "dv"
	  followed by a list of variable names.	 The "load symbol
	  table" command must first be invoked; the recognized
	  variable names is displayed by the "variable" command.


     go

	  The program under debug begins execution at the instruction
	  pointed to by the current IP.


     help

	  The list of Host mode debugging commands with their
	  operands is displayed.


     inspect <MODULE NAME>

	  The module to which the names apply is changed to the
	  given name.  If no name is given, the name of the
	  current module is displayed.	The "module" command will
	  display the recognized module names.


     load symbol table <FILENAME>

	  A symbol table is produced by the "lc" command using the
	  "-s" option.	Before using the symbolic features of "adb",
	  this symbol table must first be loaded by typing "l" and
	  then the name of the file containing the symbol table.


     modules

	  The names of the recognized modules are displayed.





				  - 188 -





     ADB(1)						      ADB(1)


     node mode

	  Node mode is invoked and logical node 0 is selected.	The
	  new prompt is "Node 0>" and the commands listed below
	  under Node Mode are available.  If a subcube has not been
	  allocated, a message is displayed and the command is
	  refused.


     quit

	  The "adb" command is terminated.  The process being
	  debugged remains in existence, so "adb" can be reentered.


     registers

	  The current values of the 80286 registers are displayed.
	  One segment register, called "us" (user), is not a
	  hardware register but is available for examing segments
	  without affecting subsequent program execution.  Also the
	  instruction pointed to by IP is displayed.


     set {<ADDR>| var <VARIABLE>}

	  In the first option, the contents of memory at ADDR are
	  displayed and can be altered by typing a new hex value.
	  Typing a <LF> causes the command to be repeated for the
	  word at the next higher address.  A <CR> terminates the
	  command.  The second option is invoked by typing "sv"
	  followed by a variable name.	The value of the variable
	  is displayed and can be altered.


     trace

	  Typing "t" causes the registers (including the IP and the
	  first three bytes of the instruction it points to) to be
	  displayed and the system waits for a response.  A <LF>
	  causes the instruction pointed to by the IP to be
	  executed and the registers to be redisplayed.	 Each
	  <LF> executes the next instruction.  Interrupts
	  (system calls) are not traced but are executed at full
	  speed.  A <CR> terminates the trace command.










				  - 189 -





     ADB(1)						    ADB(1)


     variables <MODULE NAME>

	  The recognized variables in the named module are displayed.
	  If no module name is given, the current module is used. The
	  variables include names, labels and line numbers.  Labels
	  are preceded by "?" and both labels and line numbers can be
	  used in the breakpoint command.


     working segment [pcs|stk|code|data|eseg|user] (default is data)

	  When the debugger is entered, the working segment is the
	  data segment.	 It can be changed by typing the first
	  letter of the segment desired: "p","s","c","d","e","u".
	  The code segment is assumed for the breakpoint command.


     zlog into file <FILENAME>

	  The debug session is logged into the named file.



     NODE MODE ("node #>")

     286 mode

	  Typing a "2" returns "adb" to the Host mode.


     breakpoint {<ADDR>| label <LABEL>}

	  In the first option, a breakpoint is set at location ADDR.
	  (ADDR should be the location of an instruction.)  Only one
	  breakpoint per node can be active at a time (the last one
	  entered is active).  When the breakpoint is encountered, the
	  debugger prompt ("+") is displayed.  The second option is
	  invoked by typing "bl" followed by one of the recognized
	  node program labels.	The "load symbol table" command in
	  Node Mode must have been executed first.  The "variables"
	  command in Node Mode displays the recognized labels.


     display {<ADDR>,<LENGTH>| var <VARIABLE>}

	  Memory from ADDR to ADDR+LENGTH-1 in the currently
	  selected node is displayed.  The second option is invoked
	  by typing "dv" followed by a list of variable names.	The
	  "load symbol table" command in Node Mode must first be
	  invoked; the recognized variable names is displayed by the
	  "variable" command in Node Mode.




				  - 190 -





     ADB(1)						    ADB(1)


     go <VALUE>

	  The program under debug in the currently selected node
	  is set to the status of "VALUE".  If no "VALUE" (or 0) is
	  given, the program is set to "ready" and begins execution
	  at the location pointed to by the program counter.  A
	  "VALUE" of 2 will cause the program to stop (pause).


     help

	  The list of commands in node mode are displayed.


     inspect <MODULE NAME>

	  The module to which the names apply is changed to the
	  given name.  If no name is given, the name of the
	  current module is displayed.	The "module" command will
	  display the recognized module names.


     load symbol table <FILENAME>

	  A node symbol table is produced by the "lcn" command
	  using the "-s" option.  Before using the symbolic
	  features of the Node Mode of "adb", this symbol table
	  must first be loaded by typing "l" and then the name of
	  the file containing the node symbol table.


     modules

	  The names of the recognized node modules are displayed.


     pick <NODE NUMBER>

	  The currently selected node becomes node "NODE NUMBER"
	  which is a logical node number in the currently selected
	  subcube.


     quit

	  The "adb" command is terminated.  The process being
	  debugged remains in existence, so "adb" can be reentered.








				  - 191 -





     ADB(1)						  ADB(1)


     register stat

	  If the process in the currently selected node is stopped,
	  the 16 general registers along with the Program Status,
	  the Stack Pointer and the Program Counter are displayed.
	  If the program is not stopped, the result is undefined.


     set {<ADDR>| var <VARIABLE>}

	  The contents of memory at ADDR in the currently selected
	  node are displayed and can be altered by typing a new
	  hex value.  A <LF> causes the command to be repeated for
	  the word at the next higher address.	A <CR> terminates
	  the command.	The second option is invoked by typing "sv"
	  followed by a variable name.	The value of the variable
	  is displayed and can be altered.


     trace

	  The program in the currently selected node is put in trace
	  mode which is equivalent to the trace mode for the Host
	  mode.


     yconnect to node

	  Every key typed is sent as a message to the currently
	  selected node.  The first character of every message
	  returned from the node is displayed on the terminal.
	  To terminate the connection, type "↑@" (↑spacebar)


     zload program <FILENAME>

	  If the file in FILENAME is in the NCUBE executable format
	  then the file is loaded in the node as a program and
	  execution is started.
















				  - 192 -





     AS(1)						    AS(1)


     NAME

     as -- assembler (80286 target)


     SYNOPSIS

     as [-l listfile] [-e exefile] file ...


     DESCRIPTION

     The  concatenation of the named files is assembled by  "as"  with
     the  80286 both host and target.   The assembler output is put in
     the  file "exefile" which is executable if there are no  assembly
     errors  or unresolved references.   If "exefile" is  omitted  the
     assembler  output  is  put  in "a.out".   If  the  "listfile"  is
     omitted, the listing is sent to the standard output.

     The   assembler   treats  the  first  operand  of   two   address
     instructions as the destination.   The exceptions to this are the
     instructions  whose mnemonics end in "m" and whose source is  not
     an immediate operand.  The default for the "w" bit (see below) is
     w=0  (byte)  unless  the operands are 16 bit  register  names  or
     "word"  preceds  the  memory  address  specification.   A  memory
     address specification is given in the format:   DISP[addr  mode].
     A few examples should make the above points clear.

	  mov ax,bx;		   !move bx to ax;
	  addm al,addr+3[ibx];	   !move al to memory with "ibx" mode;
	  movim word start[idi],0; !move 0 to memory word with "idi";

     The source code for a fairly long assembly language program is in
     the file "/usr/ncube/sample/cmd.src".

     This  program illustrates most of the facilities of the assembler
     and  is also a "shell" for creating new  commands.   It  includes
     support routines for number conversions and input/output.

     The  following  sections  list  the  instruction  mnemonics   and
     encodings,  the addressing modes and psuedo operations recognized
     by the assembler.













				  - 193 -





     AS(1)						    AS(1)


     DATA TRANSFER

     mov    [reg/mem to reg]  | 1000 101w |mod reg r/m|
     movm   [reg to reg/mem]  | 1000 100w |mod reg r/m|
     movi   [imm to reg]      | 1011 wreg |   data    | data(w=1) |
     movim  [imm to mem]      | 1100 011w |mod 000 r/m|	  data	  |  *
     mova   [mem to acc]      | 1010 000w | addr low  | addr high |
     movam  [acc to mem]      | 1010 001w | addr low  | addr high |
     movs   [reg/mem to seg]  | 1000 1110 |mod 0sg r/m|
     movsm  [seg to reg/mem]  | 1000 1100 |mod 0sg r/m|
     pushi  [imm]	      | 0110 10s0 |   data    | data(s=0) |
     push   [reg]	      | 0101 0reg |
     pushm  [mem]	      | 1111 1111 |mod 110 r/m|
     pushs  [seg]	      | 000seg110 |   seg = {00,01,10,11}
     pushf  [flags]	      | 1001 1100 |
     pusha  [all]	      | 0110 0000 |
     pop    [reg]	      | 0101 1reg |
     popm   [mem]	      | 1000 1111 |mod 000 r/m|
     pops   [seg]	      | 000seg111 |   seg = {00,10,11}
     popf   [flags]	      | 1001 1101 |
     popa   [all]	      | 0110 0001 |
     xchg   [reg/mem<--->reg] | 1000 011w |mod reg r/m|
     xchga  [reg<--->acc]     | 1001 0reg |
     in	    [fixed, byte]     | 1110 0100 |   port    |
     inw    [fixed, word]     | 1110 0101 |   port    |
     inv    [variable, byte]  | 1110 1100 |
     invw   [variable, word]  | 1110 1101 |
     out    [fixed, byte]     | 1110 0110 |   port    |
     outw   [fixed, word]     | 1110 0111 |   port    |
     outv   [variable, byte]  | 1110 1110 |
     outvw  [variable, word]  | 1110 1111 |
     xlat   [translate AL]    | 1101 0111 |
     lea    [EA to reg]	      | 1000 1101 |mod reg r/m|
     lds    [pointer to DS]   | 1100 0101 |mod reg r/m|	 mod <> 11
     les    [pointer to ES]   | 1100 0100 |mod reg r/m|	 mod <> 11
     lahf   [flags to AH]     | 1001 1111 |
     sahf   [AH to flags]     | 1001 1110 |


     *: data(w=1)















				  - 194 -





     AS(1)						    AS(1)


     ARITHMETIC

     add    [reg/mem to reg]  | 0000 001w |mod reg r/m|
     addm   [reg to reg/mem]  | 0000 000w |mod reg r/m|
     addi   [imm to reg/mem]  | 1000 000w |mod 000 r/m|	  data	  |  *
     addia  [imm to acc]      | 0000 010w |   data    | data(w=1) |
     adc    [reg/mem to reg]  | 0001 001w |mod reg r/m|
     adcm   [reg to reg/mem]  | 0001 000w |mod reg r/m|
     adci   [imm to reg/mem]  | 1000 000w |mod 010 r/m|	  data	  |  *
     adcia  [imm to acc]      | 0001 010w |   data    | data(w=1) |
     inc    [reg]	      | 0100 0reg |
     incm   [reg/mem]	      | 1111 111w |mod 000 r/m|
     sub    [rg/mem from reg] | 0010 101w |mod reg r/m|
     subm   [reg from rg/mem] | 0010 100w |mod reg r/m|
     subi   [imm from rg/mem] | 1000 000w |mod 101 r/m|	  data	  |  *
     subia  [imm from acc]    | 0010 110w |   data    | data(w=1) |
     sbb    [rg/mem from reg] | 0001 101w |mod reg r/m|
     sbbm   [reg from rg/men] | 0001 100w |mod reg r/m|
     sbbi   [imm from rg/mem] | 1000 000w |mod 011 r/m|	  data	  |  *
     sbbia  [imm from acc]    | 0001 110w |   data    | data(w=1) |
     dec    [reg]	      | 0100 1reg |
     decm   [reg/mem]	      | 1111 111w |mod 001 r/m|
     cmp    [rg/mem with reg] | 0011 101w |mod reg r/m|
     cmpm   [reg with rg/mem] | 0011 100w |mod reg r/m|
     cmpi   [imm with rg/mem] | 1000 000w |mod 111 r/m|	  data	  |  *
     cmpia  [imm with acc]    | 0011 110w |   data    | data(w=1) |
     neg    [change sign]     | 1111 011w |mod 011 r/m|
     aaa    [ASCII adj add]   | 0011 0111 |
     daa    [dec adjust add]  | 0010 0111 |
     aas    [ASCII adj sub]   | 0011 1111 |
     das    [dec adjust add]  | 0010 1111 |
     mul    [unsigned]	      | 1111 011w |mod 100 r/m|
     imul   [signed]	      | 1111 011w |mod 101 r/m|
     div    [unsigned]	      | 1111 011w |mod 110 r/m|
     aam    [ASCII adj mul]   | 1101 0100 | 0000 1010 |
     aad    [ASCII adj div]   | 1101 0101 | 0000 1010 |
     cbw    [byte to word]    | 1001 1000 |
     cwd    [word to dw]      | 1001 1001 |


     *: data(w=1)














				  - 195 -





     AS(1)						    AS(1)

     LOGIC

     rol    [rotate left]     | 1101 00rw |mod 000 r/m| 1(r=0) cl(r=1)
     ror    [rotate right]    | 1101 00rw |mod 001 r/m| 1(r=0) cl(r=1)
     rcl    [rotate carry lt] | 1101 00rw |mod 010 r/m| 1(r=0) cl(r=1)
     rcr    [rotate carry rt] | 1101 00rw |mod 011 r/m| 1(r=0) cl(r=1)
     sal    [shift left]      | 1101 00rw |mod 100 r/m| 1(r=0) cl(r=1)
     shl    [same as sal]
     shr    [shift right]     | 1101 00rw |mod 101 r/m| 1(r=0) cl(r=1)
     sar    [shift rt arith]  | 1101 00rw |mod 111 r/m| 1(r=0) cl(r=1)
     roli   [rotate lt count] | 1100 000w |mod 000 r/m|	  count	  |
     rori   [rotate rt count] | 1100 000w |mod 001 r/m|	  count	  |
     rcli   [rot lt cr count] | 1100 000w |mod 010 r/m|	  count	  |
     rcri   [rot rt cr count] | 1100 000w |mod 011 r/m|	  count	  |
     sali   [shift lt count]  | 1100 000w |mod 100 r/m|	  count	  |
     shli   [same as sali]
     shri   [shift rt count]  | 1100 000w |mod 101 r/m|	  count	  |
     sari   [sft rt arth cnt] | 1100 000w |mod 111 r/m|	  count	  |
     and    [reg/mem to reg]  | 0010 001w |mod reg r/m|
     andm   [reg to reg/mem]  | 0010 000w |mod reg r/m|
     andi   [imm to reg/mem]  | 1000 000w |mod 100 r/m|	  data	  |  *
     andia  [imm to acc]      | 0010 010w |   data    | data(w=1) |
     test   [reg/mem and reg] | 1000 010w |mod reg r/m|
     testi  [imm and reg/mem] | 1111 011w |mod 000 r/m|	  data	  |  *
     testia [imm and acc]     | 1010 100w |   data    | data(w=1) |
     or	    [reg/mem to reg]  | 0000 101w |mod reg r/m|
     orm    [reg to reg/mem]  | 0000 100w |mod reg r/m|
     ori    [imm to reg/mem]  | 1000 000w |mod 001 r/m|	  data	  |  *
     oria   [imm to acc]      | 0000 110w |   data    | data(w=1) |
     xor    [reg/mem to reg]  | 0011 001w |mod reg r/m|
     xorm   [reg to reg/mem]  | 0011 000w |mod reg r/m|
     xori   [imm to reg/mem]  | 1000 000w |mod 110 r/m|	  data	  |  *
     xoria  [imm to acc]      | 0011 010w |   data    | data(w=1) |
     not    [reg/mem]	      | 1111 011w |mod 010 r/m|

     *: data(w=1)


     STRING MANIPULATION

     rep    [CX=count]	      | 1111 0010 |
     repe		      | 1111 0011 |
     repne		      | 1111 0010 |
     repz		      | 1111 0011 |
     repnz		      | 1111 0010 |
     smove  [string move]     | 1010 010w |
     scmp   [string compare]  | 1010 011w |
     sscan  [string scan]     | 1010 111w |
     sload  [string load]     | 1010 110w |
     sstor  [string store]    | 1010 101w |
     ins    [input string]    | 0110 110w |
     outs   [output string]   | 0110 111w |




				  - 196 -





     AS(1)						    AS(1)


     CONTROL TRANSFER

     call   [direct in seg]   | 1110 1000 | disp-low  | disp-high |
     callm  [reg/mem ind]     | 1111 1111 |mod 010 r/m|
     calldi [direct interseg] | 1001 1010 |offset-word| selec-word|
     callii [indir interseg]  | 1111 1111 |mod 011 r/m|	  mod<>11
     jmp    [direct in seg]   | 1110 1011 | disp-low  |
     jmpl   [dir in seg long] | 1110 1001 | disp-low  | disp-high |
     jmpm   [reg/mem ind]     | 1111 1111 |mod 100 r/m|
     jmpdi  [direct interseg] | 1110 1010 |offset-word| selec-word|
     jmpii  [indir interseg]  | 1111 1111 |mod 101 r/m|	  mod<>11
     ret    [in seg]	      | 1100 0011 |
     retsp  [in seg add SP]   | 1100 0010 | data-low  | data-high |
     reti   [inter seg]	      | 1100 1011 |
     retisp [interseg add SP] | 1100 1010 | data-low  | data-high |
     jo	    [overflow]	      | 0111 0000 |   disp    |
     jno    [not overflow]    | 0111 0001 |   disp    |
     js	    [sign]	      | 0111 1000 |   disp    |
     jns    [not sign]	      | 0111 1001 |   disp    |
     jc/jb/jnae	 [carry]      | 0111 0010 |   disp    |
     jnc/jnb/jae [not carry]  | 0111 0011 |   disp    |
     je/jz   [equal, zero]    | 0111 0100 |   disp    |
     jne/jnz [not equal,zero] | 0111 0101 |   disp    |
     jl/jnge [less]	      | 0111 1100 |   disp    |
     jle/jng [less or equal]  | 0111 1110 |   disp    |
     jbe/jna [below or equal] | 0111 0110 |   disp    |
     jnl/jge [not less]	      | 0111 1101 |   disp    |
     jg/jnle [greater]	      | 0111 1111 |   disp    |
     ja/jnbe [above]	      | 0111 0111 |   disp    |
     jp/jpe  [parity, even]   | 0111 1010 |   disp    |
     jnp/jpo [not parity odd] | 0111 1011 |   disp    |
     loop    [CX count]	      | 1110 0010 |   disp    |
     loopz/loope   [zero]     | 1110 0001 |   disp    |
     loopnz/loopne [not zero] | 1110 0000 |   disp    |
     jcxz    [jump CX zero]   | 1110 0011 |   disp    |
     int     [interrupt]      | 1100 1101 |   type    |
     int3    [interrupt 3]    | 1100 1100 |
     into    [interrupt ovfl] | 1100 1110 |
     iret    [interrupt ret]  | 1100 1111 |
     leave   [leave proc]     | 1100 1001 |
     bound   [range check]    | 0110 0010 |mod reg r/m|














				  - 197 -





     AS(1)						    AS(1)


     PROCESSOR CONTROL

     nop   [no operation]     | 1001 0000 |
     clc   [clear carry]      | 1111 1000 |
     cmc   [complement carry] | 1111 0101 |
     stc   [set carry]	      | 1111 1001 |
     cld   [clear direction]  | 1111 1100 |
     std   [set direction]    | 1111 1101 |
     cli   [clear interrupt]  | 1111 1010 |
     sti   [set interrupt]    | 1111 1011 |
     hlt   [halt]	      | 1111 0100 |
     wait		      | 1001 1011 |
     lock  [bus lock]	      | 1111 0000 |
     cts   [clear task flag]  | 0000 1111 | 0000 0110 |
     esc   [escape]	      | 1101 1TTT |mod LLL r/m|
     eseg  [override prefix]  | 0010 0110 |
     cseg  [override prefix]  | 0010 1110 |
     sseg  [override prefix]  | 0011 0110 |
     dseg  [override prefix]  | 0011 1110 |


     PROTECTION CONTROL

     lgdt  [load gdt]	      | 0000 1111 | 0000 0001 |mod 010 r/m|
     sgdt  [store gdt]	      | 0000 1111 | 0000 0001 |mod 000 r/m|
     lidt  [load idt]	      | 0000 1111 | 0000 0001 |mod 011 r/m|
     sidt  [store idt]	      | 0000 1111 | 0000 0001 |mod 001 r/m|
     lldt  [load ldt]	      | 0000 1111 | 0000 0000 |mod 010 r/m|
     sldt  [store ldt]	      | 0000 1111 | 0000 0000 |mod 000 r/m|
     ltr   [load task reg]    | 0000 1111 | 0000 0000 |mod 011 r/m|
     str   [store task reg]   | 0000 1111 | 0000 0000 |mod 001 r/m|
     lmsw  [load status]      | 0000 1111 | 0000 0001 |mod 110 r/m|
     smsw  [store status]     | 0000 1111 | 0000 0001 |mod 100 r/m|
     lar   [load access rgts] | 0000 1111 | 0000 0010 |mod reg r/m|
     lsl   [load seg limit]   | 0000 1111 | 0000 0011 |mod reg r/m|
     arpl  [adj priv level]   |		  | 0110 0011 |mod reg r/m|
     verr  [verify read acc]  | 0000 1111 | 0000 0000 |mod 100 r/m|
     verw  [verify write acc] | 0000 1111 | 0000 0000 |mod 101 r/m|

















				  - 198 -





     AS(1)						    AS(1)



     FLOATING POINT INSTRUCTIONS (80287)

     fldsr [load short real]  | 1101 1001 |mod 000 r/m|	  disp	  |
     fldsi [load short int]   | 1101 1011 |mod 000 r/m|	  disp	  |
     fldlr [load long real]   | 1101 1101 |mod 000 r/m|	  disp	  |
     fldw  [load integer]     | 1101 1111 |mod 000 r/m|	  disp	  |
     fldli [load long int]    | 1101 1111 |mod 101 r/m|	  disp	  |
     fldtr [load temp real]   | 1101 1011 |mod 101 r/m|	  disp	  |
     fldbcd [load BCD]	      | 1101 1111 |mod 100 r/m|	  disp	  |
     fldst [load stack]	      | 1101 1001 | 11 000 sti|
     fstsr [store short real] | 1101 1001 |mod 010 r/m|	  disp	  |
     fstsi [store short int]  | 1101 1011 |mod 010 r/m|	  disp	  |
     fstlr [store long real]  | 1101 1101 |mod 010 r/m|	  disp	  |
     fstw [store integer]     | 1101 1111 |mod 010 r/m|	  disp	  |
     fstst [store stack]      | 1101 1101 | 11 010 sti|
     fstpsr [pop short real]  | 1101 1001 |mod 011 r/m|	  disp	  |
     fstpsi [pop short int]   | 1101 1011 |mod 011 r/m|	  disp	  |
     fstplr [pop long real]   | 1101 1101 |mod 011 r/m|	  disp	  |
     fstpw [pop integer]      | 1101 1111 |mod 011 r/m|	  disp	  |
     fstpli [pop long int]    | 1101 1111 |mod 111 r/m|	  disp	  |
     fstptr [pop temp real]   | 1101 1011 |mod 111 r/m|	  disp	  |
     fstpbcd [pop BCD]	      | 1101 1111 |mod 110 r/m|	  disp	  |
     fstpst [pop stack]	      | 1101 1101 | 11 011 sti|
     fxch [exchange]	      | 1101 1001 | 11 001 sti|
     fcomsr [compare sh real] | 1101 1000 |mod 010 r/m|	  disp	  |
     fcomsi [compare sh int]  | 1101 1010 |mod 010 r/m|	  disp	  |
     fcomlr [compare lg real] | 1101 1100 |mod 010 r/m|	  disp	  |
     fcomw [compare integer]  | 1101 1110 |mod 010 r/m|	  disp	  |
     fcomst [compare stack]   | 1101 1000 | 11 010 sti|
     fcompsr [comp/pop sh rl] | 1101 1000 |mod 011 r/m|	  disp	  |
     fcompsi [comp/pop sh in] | 1101 1010 |mod 011 r/m|	  disp	  |
     fcomplr [comp/pop lg rl] | 1101 1100 |mod 011 r/m|	  disp	  |
     fcompw [comp/pop int]    | 1101 1110 |mod 011 r/m|	  disp	  |
     fcompst [comp/pop stack] | 1101 1000 | 11 011 sti|
     fcompp [comp/pop/pop]    | 1101 1110 | 11 011 001|
     faddsr [add short real]  | 1101 1000 |mod 000 r/m|	  disp	  |
     faddsi [add short int]   | 1101 1010 |mod 000 r/m|	  disp	  |
     faddlr [add long real]   | 1101 1100 |mod 000 r/m|	  disp	  |
     faddw [add integer]      | 1101 1110 |mod 000 r/m|	  disp	  |
     faddst [add stack]	      | 1101 1000 | 11 000 sti|
     faddpst [add/pop stack]  | 1101 1110 | 11 000 sti|
     fsubsr [sub short real]  | 1101 1000 |mod 100 r/m|	  disp	  |
     fsubsi [sub short int]   | 1101 1010 |mod 100 r/m|	  disp	  |
     fsublr [sub long real]   | 1101 1100 |mod 100 r/m|	  disp	  |
     fsubw [sub integer]      | 1101 1110 |mod 100 r/m|	  disp	  |
     fsubst [sub stack]	      | 1101 1000 | 11 100 sti|
     fsubpst [sub/pop stack]  | 1101 1110 | 11 100 sti|	  disp	  |







				  - 199 -





     AS(1)						    AS(1)


     FLOATING POINT INSTRUCTIONS (continued)

     fmulsr [mul short real]  | 1101 1000 |mod 001 r/m|	  disp	  |
     fmulsi [mul short int]   | 1101 1010 |mod 001 r/m|	  disp	  |
     fmullr [mul long real]   | 1101 1100 |mod 001 r/m|	  disp	  |
     fmulw [mul integer]      | 1101 1110 |mod 001 r/m|	  disp	  |
     fmulst [mul stack]	      | 1101 1000 | 11 001 sti|
     fmulpst [mul/pop stack]  | 1101 1110 | 11 001 sti|
     fdivsr [div short real]  | 1101 1000 |mod 110 r/m|	  disp	  |
     fdivsi [div short int]   | 1101 1010 |mod 110 r/m|	  disp	  |
     fdivlr [div long real]   | 1101 1100 |mod 110 r/m|	  disp	  |
     fdivw [div integer]      | 1101 1110 |mod 110 r/m|	  disp	  |
     fdivst [div stack]	      | 1101 1000 | 11 110 sti|
     fdivpst [div/pop stack]  | 1101 1110 | 11 110 sti|
     ftst [test for zero]     | 1101 1001 | 11 100 100|
     fxam [examine top]	      | 1101 1001 | 11 100 101|
     fsqrt [square root]      | 1101 1001 | 11 111 010|
     fscale [scale top]	      | 1101 1001 | 11 111 101|
     fprem [remainder]	      | 1101 1001 | 11 111 000|
     frndint [round to int]   | 1101 1001 | 11 111 100|
     fxtract [extract exp]    | 1101 1001 | 11 110 100|
     fabs [absolute value]    | 1101 1001 | 11 100 001|
     fchs [change sign]	      | 1101 1001 | 11 100 000|
     fptan [tangent]	      | 1101 1001 | 11 110 010|
     fpatan [arctangent]      | 1101 1001 | 11 110 011|
     f2xm1 [2**x-1]	      | 1101 1001 | 11 110 000|
     fyl2x [y*log(x)]	      | 1101 1001 | 11 110 001|
     fyl2xp1 [y*log(x+1)]     | 1101 1001 | 11 111 001|
     fldz [load zero]	      | 1101 1001 | 11 101 110|
     fld1 [load one]	      | 1101 1001 | 11 101 000|
     fldpi [load pi]	      | 1101 1001 | 11 101 011|
     fldl2t [load log(10)]    | 1101 1001 | 11 101 001|
     fldl2e [load log(e)]     | 1101 1001 | 11 101 010|
     fldlg2 [load log(2)]     | 1101 1001 | 11 101 100|
     fldln2 [load ln(2)]      | 1101 1001 | 11 101 101|
     finit [initialize]	      | 1101 1011 | 11 100 011|
     fsetpm [set protected]   | 1101 1011 | 11 100 100|
     feni [enable interrupts] | 1101 1011 | 11 100 000|
     fdisi [disable ints]     | 1101 1011 | 11 100 001|
     fclex [clear exceptions] | 1101 1011 | 11 100 010|
     fincstp [incr stk ptr]   | 1101 1001 | 11 110 111|
     fdecstp [decr stk ptr]   | 1101 1001 | 11 110 110|
     fnop [no operation]      | 1101 1001 | 11 010 000|
     fldcw [load control]     | 1101 1001 |mod 101 r/m|	  disp	  |
     fstcw [store control]    | 1101 1001 |mod 111 r/m|	  disp	  |
     fstsw [store status]     | 1101 1101 |mod 111 r/m|	  disp	  |
     fldenv [load environ]    | 1101 1001 |mod 100 r/m|	  disp	  |
     fstenv [store environ]   | 1101 1001 |mod 110 r/m|	  disp	  |
     fsave [save state]	      | 1101 1101 |mod 110 r/m|	  disp	  |
     frstor [restore state]   | 1101 1101 |mod 100 r/m|	  disp	  |
     ffree [free register]    | 1101 1101 | 11 000 sti|




				  - 200 -





     AS(1)						    AS(1)


     ADDRESSING MODES

     seg = {es (00), cs (01), ss (10), ds (11)}

     segment override = {eseg,cseg,sseg,dseg}

     reg = {al,bl,cl,dl,ah,bh,ch,dh,ax,bx,cx,dx,sp,bp,si,di}

     reg field:
	  000:	al (w=0)  ax (w=1)	 001:  cl (w=0)	 cx (w=1)
	  010:	dl (w=0)  dx (w=1)	 011:  bl (w=0)	 bx (w=1)
	  100:	ah (w=0)  sp (w=1)	 101:  ch (w=0)	 bp (w=1)
	  110:	dh (w=0)  si (w=1)	 111:  bh (w=0)	 di (w=1)

     mod field:
	  00:  DISP=0		   10:	DISP=disp-high;disp-low
	  01:  DISP=disp-low	   11:	r/m is treated as reg field

     r/m field:
	  bxsi:	 000  EA=(bx)+(si)+DISP
	  bxdi:	 001  EA=(bx)+(di)+DISP
	  bpsi:	 010  EA=(bp)+(si)+DISP
	  bpdi:	 011  EA=(bp)+(di)+DISP
	  isi:	 100  EA=(si)+DISP
	  idi:	 101  EA=(di)+DISP
	  ibp:	 110  EA=(bp)+DISP
	  ibx:	 111  EA=(bx)+DISP
	  exception:  if mod=00 and r/m=110 then EA=disp-high:disp-low


     PSEUDO OPERATIONS

     byte (force w=0)	  word (force w=1)     cons (define constant)
     db (define byte)	  dw (define word)     page (start new page)
     ! (comment)	  headline (header)    entry (execution start)
     ; (end of field)	  dm (allocate mem)    org (start assembly)
     odd (set PC odd)	  even (set PC even)   codseg (define segment)
     segcnt (segments)	  filcnt (open files)  datseg (define segment)
     stksize (stack)

     Text is defined using "db".   For example:	   db	5,"hello",6

     Defaults are segcnt(32), filcnt(8), stksize(512), initial segment
     (codseg), datseg (org=0), codseg (org=0).

     Expressions may use {+,-,*,/,(,)} but may not use floating point.


     FILES

     exe(5)




				  - 201 -





     ASN(1)						    ASN(1)


     NAME

     asn -- cross assembler (NCUBE processor target)


     SYNOPSIS

     asn [-l[x] listfile] [-e exefile] file ...


     DESCRIPTION
     The named files are concatenated and assembled by "asn" using the
     80286 as host and the NCUBE processor as target.   The output  of
     the assembler is put in "exefile" ; if "exefile" is not specified
     the output is put in "an.out".   If there are no assembly  errors
     or  unresolved  references,  the assembler output is  executable.
     The listing is put in "listfile" or if omitted,  in the  standard
     output.   If the "x" argument is included,  a cross reference  is
     added to the "listfile".

     The  following  sections summarize the instruction mnemonics  and
     encodings, addressing modes and other processor details.


     Instruction Format


			     0, 1, 2  Addresses
       OPCODE	MODE	OFFSET/LIT. (opt)   MODE    OFFSET/LIT. (opt)
     -----------------------------------------------------------------
     | OP TP || MD RG |			  | MD RG |		     |
     -----------------------------------------------------------------
     7	43  0 7	 43  0
	|    |							     |
	|    |←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←|
	|				 |
	|				 |
	|
	|		       0,1 or 2 Addresses
	|←←←←←←
	       Low Address in Memory

     In  the  two address form shown above,  the first  address  is  a
     source   operand  and  the  second  is  both  a  source  and  the
     destination.   The  assembly language ordering convention is  the
     same.  For example, the assembly code:  SUBW  A,B  is interpreted
     as:  (B-A)-->B.








				  - 202 -





     ASN(1)						    ASN(1)


     In the opcode table shown below,  the first field (TP)  specifies
     the  length  and type of the operands (B,H,W,R,L) and the  second
     field  (OP)  specifies  the  operation  and  number  of  operands
     (SUB,NOT,etc).


				     TP
				   ------
		 B     H     W		 R     L
	       ----------------------------------------------
		 0     2     4	   6	 8     A     C	   E
	       ----------------------------------------------
	   0   MOVB  MOVH  MOVW	  RES  MOVR  MOVL   RES	  RES
	   1   NEGB  NEGH  NEGW	  RES  NEGR  NEGL   RES	  REP
	   2   SBRB  SBRH  SBRW	  RES  SBRR  SBRL   RES	 REPZ
	   3   CMPB  CMPH  CMPW	  RES  CMPR  CMPL   RES REPNZ
	   4   ADDB  ADDH  ADDW	  RES  ADDR  ADDL   RES	 TRAP
	   5   ADCB  ADCH  ADCW	  RES  SQTR  SQTL   RES	  RES
	   6   SUBB  SUBH  SUBW	  RES  SUBR  SUBL   RES	  RES
      OP   7   SBBB  SBBH  SBBW	  RES  SGNR  SGNL   RES	  RES
	   8   MULB  MULH  MULW	  RES  MULR  MULL   RES	  RES
	   9   DVRB  DVRH  DVRW	  RES  DVRR  DVRL   RES	  RES
	   A   REMB  REMH  REMW	  RES  REMR  REML   RES	  RES
	   B   DIVB  DIVH  DIVW	  RES  DIVR  DIVL   RES	  RES
	   C   BITB  BITH  BITW	  RES	RES   RES   RES	  RES
	   D	RES   RES   RES	  RES	RES   RES   RES	  RES
	   E	RES   RES   RES	  RES	RES   RES   RES	  RES
	   F	RES   RES   RES	  RES	ESC   ESC   ESC	  RES


				     TP
				   ------
		 1     3     5	   7	 9     B     D	   F
	       ----------------------------------------------
	   0   SFTB  SFTH  SFTW	  RES  CVBR   NOP   RES	   BG
	   1   SFAB  SFAH  SFAW	  RES  CVHR   CLC   RES	  BLE
	   2   ROTB  ROTH  ROTW	  RES	RES   STC   RES	  BGU
	   3   FFOB  FFOH  FFOW	  RES  CVLR   CMC   RES	 BLEU
	   4   ANDB  ANDH  ANDW	  RES  CVBL  ERON   RES	  BGE
	   5	ORB   ORH   ORW	  RES  CVHL  EROF   RES	   BL
	   6   XORB  XORH  XORW	  RES  CVWL  BKPT   RES	 BGEU
      OP   7   NOTB  NOTH  NOTW	  RES  CVRL  RSET   RES	  BLU
	   8   ADCD   RES  LDPR	  RES  CVBW    EI   RES	  BNE
	   9   SBBD   RES  STPR	  RES  CVHW    DI   RES	   BE
	   A	RES   RES  LCNT	  RES  CVWB  WAIT   RES	  BNV
	   B	RES   RES  LPTR	  RES  CVWH   RES   RES	   BV
	   C	RES   RES  BCNT	  RES	RES  RETI   RES	 CALL
	   D	RES   RES  BPTR	  RES	RES  RETT   RES	  JMP
	   E	RES   RES  MOVA	  RES	RES   RET   RES	 RETP
	   F	ESC   ESC   ESC	  ESC	ESC   ESC   ESC	  ESC





				  - 203 -





     ASN(1)						    ASN(1)


     Addressing Modes

     MNEMONIC	  ENCODING	 DEFINITION
		  MD	REG	      ←←←←
	 #	 0000  LLLL    Literal	  |
	 #	 0001  LLLL    Literal	  |←←← (Integer: -32 to 31)
	 #	 0010  LLLL    Literal	  |    (Real: -32 to 31)
	 #	 0011  LLLL    Literal←←←←|
	 Rn	 1100  RRRR    Register Direct
	(Rn)	 0100  RRRR    Register Indirect
       -(Rn)	 1101  RRRR    Autodecrement
	(Rn)+	 0110  RRRR    Autoincrement
       @(Rn)+	 0111  RRRR    Autoincrement Indirect
	(Rn)++	 0101  RRRR    Autoskip
       A(Rn)	 1000  RRRR    Byte Offset+Register
       A(Rn)	 1001  RRRR    Halfword Offset+Register
       A(Rn)	 1010  RRRR    Word Offset+Register
      @A(Rn)	 1011  RRRR    (Word Offset+Register) Indirect
       A(PC)	 1111  0000    Byte Offset+PC
       A(PC)	 1111  0001    Halfword Offset+PC
       A(PC)	 1111  0010    Word Offset+PC
      @A(PC)	 1111  0011    (Word Offset+PC) Indirect
       A(SP)	 1111  0100    Byte Offset+SP
       A(SP)	 1111  0101    Halfword Offset+SP
       A(SP)	 1111  0110    Word Offset+SP
      @A(SP)	 1111  0111    (Word Offset+SP) Indirect
       A	 1111  1000    Byte Direct
       A	 1111  1001    Halfword Direct
       A	 1111  1010    Word Direct
      @A	 1111  1011    Word Indirect
	STK	 1111  1100    Stack (Push/Pop)
	 #	 1111  1101    Immediate
		 1110  RRRR    RESERVED
		 1111  1110    RESERVED
		 1111  1111    ESCAPE




















				  - 204 -





     ASN(1)						    ASN(1)


     Processor Registers

	 P0  SP	 Stack Pointer
	 P1  PS	 Program Status
	 P2  FR	 Fault Register		 (read only)
	 P3  CR	 Configuration Register	 (read only bits 24-31)
	 P4  PI	 Processor I. D.
	 P5  TR	 Timeout Register
	 P6  OR	 Output Ready		 (read only)
	 P7  IR	 Input Ready		 (read only)
	 P8  OE	 Output Enable
	 P9  IE	 Input Enable
	P10  IP	 Input Pending		 (read only)
	P11  PE	 Parity Error		 (read only)
	P12  IO	 Input Overrun		 (read only)

	 Program Status	  Fault Register   Configuration  I/O (P5-P11)
     -----------------------------------------------------------------
      0	 C  Carry		 RU   Fl Pt    RF	    Port0
      1	 V  Integer Overflow	 RS  Rounding  RF	    Port1
      2	 Z  Zero		 GR    Bits    RF	    Port2
      3	 N  Negative		 F1   First    RF  Refresh  Port3
      4	 U  Unordered		 E1  Operand   RF   Rate    Port4
      5	 IX Inexact		 I1 Indicator  RF	    Port5
      6	 UF Underflow		 S1   Bits     RF	    Port6
      7	 FZ Floating Zero Divide F2  Second    RF	    Port7
      8	 OF Overflow		 E2  Operand   CY  Memory   Port8
      9	 IN Invalid		 I2 Indicator  CY   Speed   Port9
     10	 IIX Inexact Enable	 S2   Bits     TY  Memory   R: Reser.
     11	 Reserved		 R: Reserved   TY   Type    R
     12	 Reserved		 R	       R: Reserved  R
     13	 Reserved		 R	       R	    R
     14	 Reserved		 R	       R	    R
     15	 IV Int Overflow Enable	 R	       R	    R
     16	 CE Correc. ECC Enable	 R	       R	    R
     17	 TO Timeout Enable	 R	       R	    R
     18	 II Input Enable	 R	       R	    R
     19	 IO Output Enable	 R	       R	    R
     20	 IE Interrupt Enable	 R	       R	    R
     21	 T  Trace Enable	 R	       R	    R
     22	 Reserved		 R	       R	    R
     23	 Reserved		 R	       R	    R
     24	 RC  Round		 R	       MN	    R
     25	 RC  Control		 R	       MN	    R
     26	 RR			 R	       MN	    R
     27	 RR  Repeat		 R	       MN  Model    R
     28	 RR  Register		 R	       MN  Number   R
     29	 RR			 R	       MN	    R
     30	 RM  Repeat		 R	       MN	    R
     31	 RM  Mode		 R	       MN	    Port31





				  - 205 -





     ASN(1)						    ASN(1)


     Interrupts

	0	Reserved
	1	Trace
	2	Breakpoint
	3	Integer Overflow
	4	Integer Zero Divide
	5	Inexact
	6	Underflow
	7	Floating Zero Divide
	8	Overflow
	9	Invalid
       10	Unimplemented Opcode
       11	Address Error
       12	Stack Overflow
       13	Timeout
       14	Correctable ECC Error
       15	Uncorrectable ECC Error
       16	Operand Error
       17-31	Reserved
       32-41	Output Ready
       42-62	Reserved
       63	Output Ready (Host)
       64-73	Input Ready
       74-94	Reserved
       95	Input Ready (Host)
       96-105	Input Error
       106-126	Reserved
       127	Input Error (Host)


     Branch Conditions

	G   (N or Z) = 0		GU   (C or Z) = 0 or U = 1
	GE	   N = 0		GEU	    C = 0 or U = 1
	L	   N = 1		LU	    C = 1 or U = 1
	LE  (N or Z) = 1		LEU  (C or Z) = 1 or U = 1
	E	   Z = 1		NE	    Z = 0

















				  - 206 -





     ASN(1)						    ASN(1)


     PSEUDO OPERATIONS

     byte (force w=0)	  word (force w=1)     cons (define constant)
     db (define byte)	  dw (define word)     page (start new page)
     ! (comment)	  headline (header)    entry (execution start)
     ; (end of field)	  dm (allocate mem)    org (start assembly)
     odd (set PC odd)	  even (set PC even)   codseg (define segment)
     segcnt (segments)	  filcnt (open files)  datseg (define segment)
     stksize (stack)	  dh (define halfword) dd (define doubleword)

     Text is defined using "db".   For example:	   db	5,"hello",6

     Defaults are segcnt(32), filcnt(8), stksize(512), initial segment
     (codseg), datseg (org=0), codseg (org=0).

     Expressions may use {+,-,*,/,(,)} but may not use floating point.




     FILES

     exe(5)
































				  - 207 -





     AT(1)						    AT(1)


     NAME

     at -- execute commands at a later time


     SYNOPSIS

     at time [file]


     DESCRIPTION

     "at"  saves a copy of "file" (the default is the standard  input)
     to be used as input to the shell (sh(1) or nsh(1)) at a specified
     later time.   "time" is given as dd-mmm-yy hh:mm:ss based on a 24
     hour clock.


     SEE ALSO

     sh(1)


































				  - 208 -





     CAT(1)						    CAT(1)


     NAME

     cat -- catenate and print


     SYNOPSIS

     cat file ...


     DESCRIPTION

     "cat"  reads  each file in order and writes it  to	 the  standard
     output.  For example

		    cat file

     writes  "file" on the terminal screen (unless the standard output
     is not the terminal).  Also

		    cat file1 file2 > file3

     joins "file2" to the end of "file1" and writes the resulting file
     into "file3".

     If	 no "file" is given,  or if the argument "-"  is  used,	 "cat"
     reads  from the standard input.


     SEE ALSO

     pr(1), cp(1)


     WARNING

     Typing cat b a > a	 will cause an infinite file.


















				  - 209 -





     CD(1)						    CD(1)


     NAME

     cd -- change working directory


     SYNOPSIS

     cd [directory]


     DESCRIPTION

     "cd" makes  "directory" the new working directory.   The  default
     is to  set  the  working directory to HOME (see sh(1)).   Because
     a new process is created to  execute each command,  "cd" would be
     ineffective  if  it  were written  as  a normal  command.   It is
     therefore  recognized and executed by the Shell.  (The symbol  ""
     used with "cd" refers to the next level nearer the root.)


     SEE ALSO

     sh(1), pwd(1), chdir(2)


     DIAGNOSTICS

     If "directory" does not exist an error is returned.



























				  - 210 -





     CHFIL(1)						    CHFIL(1)


     NAME

     chfil -- change file type


     SYNOPSIS

     chfil -t type -s # -o ownername filename


     DESCRIPTION

     "chfil" sets the file type of "filename" to "type".  "type" can
     be either text or a number.  The file types and numbers are
     listed below.

		  0:  reserved ("null")
		  1:  reserved ("sys")
		  2:  device ("dev")
		  3:  binary ("bin")
		  4:  relocatable ("rel")
		  5:  executable ("exe")
		  6:  text ("text")
	       7-15:  reserved for NCUBE
	     16-255:  user defined

     "chfil" also sets the file subtype to "#"	(# must be a number)
     and the ownername to "ownername".


     SEE ALSO

     chfil(2), file(5)






















				  - 211 -





     CHMOD(1)						    CHMOD(1)


     NAME

     chmod -- change protection


     SYNOPSIS

     chmod [-a d:rcadetln f:rwed] [-r d:rcadetln f:rwed] pathname


     DESCRIPTION

     "chmod" is used to set the protection flags in the last component
     of the specified pathname (see dir(5)).  The "-a" option adds the
     corresponding  right  and  "-r" removes it.   If a right  is  not
     listed  in either option,  it is left unchanged.   The meaning of
     the rights field is given below.  The "f" signifies "file" rights
     and the "d" denotes "directory" rights.


     d:rcadetln f:rwed
       ||||||||	  ||||←←←←delete file
       ||||||||	  |||←←←←←execute file
       ||||||||	  ||←←←←←←write file
       ||||||||	  |←←←←←←←read file
       ||||||||
       ||||||||←←←←←←←←←←←change names in directory
       |||||||←←←←←←←←←←←←create and change links
       ||||||←←←←←←←←←←←←←traverse directory for file lookup
       |||||←←←←←←←←←←←←←←delete entry in directory
       ||||←←←←←←←←←←←←←←←delete directory
       |||←←←←←←←←←←←←←←←←alter access rights
       ||←←←←←←←←←←←←←←←←←create entry in directory
       |←←←←←←←←←←←←←←←←←←read contents of directory


     Rights restrictions are ignored for Superusers.   And file owners
     can always change (alter) rights to their files.


     SEE ALSO

     dir(5), chprot(2)












				  - 212 -





     CMP(1)
	 CMP(1)


     NAME

     cmp -- file compare


     SYNOPSIS

     cmp [-sl] file1 [file2]


     DESCRIPTION

     "cmp" compares the two named files byte by byte  (if  "file2"  is
     missing,  the standard input is used).  The default is to display
     the byte count of the first difference or no display if the files
     are identical.  If one file is  an	 initial  subsequence  of  the
     other, that fact is declared.  The options, only one of which may
     be	 selected,  are:  "-s" (short) causes "cmp" to display nothing
     but only to return the  exit  codes  listed  below;  "-l"	(long)
     causes  "cmp"  to	list  the locations and byte values of all the
     differences.


     DIAGNOSTICS

     The exit codes are: 0 if the files are identical; -1 if the files
     are different; <-1 for an error condition.



























				  - 213 -





     CN(1)						    CN(1)


     NAME

     cn -- change name


     SYNOPSIS

     cn name1 name2


     DESCRIPTION

     The  last	component  of "name1" is changed  to  "name2".	 Name2
     should be a string of up to 24 characters with no "/".


     SEE ALSO

     cp(1)


     DIAGNOSTICS

     If	 the  result  of changing the last  component  of  "name1"  to
     "name2" already exists, an error is returned.






























				  - 214 -





     CP(1)						    CP(1)


     NAME

     cp -- copy


     SYNOPSIS

     cp [-r] file1 file2
     cp [-r] file1 ... directory


     DESCRIPTION

     The first command form copies "file1" into "file2".  The owner of
     "file2"  is  the owner of the process that invokes "cp"  and  the
     rights are set to the maximum.  The second form copies the set of
     named  files  into "directory".   The default is not  to  replace
     existing  files but to return an error.   The "-r" option	allows
     existing files to be replaced.


     SEE ALSO

     cat(1), pr(1)































				  - 215 -





     DATE(1)						    DATE(1)


     NAME

     date -- print the date


     SYNOPSIS

     date


     DESCRIPTION

     The current date is printed assuming a 24 hour clock.


     SEE ALSO

     at(1)





































				  - 216 -





     DF(1)						    DF(1)


     NAME

     df -- disk free


     SYNOPSIS

     df [-l]


     DESCRIPTION

     "df"  prints out the number of used blocks,  the number  of  free
     blocks  and the total number of blocks (1024 byte blocks) on  all
     the  disk	drives).   Using the "-l" (long format) option	causes
     "df" to display disk reads, writes and errors.


     SEE ALSO

     du(1)


































				  - 217 -





     DIFF(1)						    DIFF(1)


     NAME

     diff -- differential file comparator


     SYNOPSIS

     diff [-efbh] file1 file2


     DESCRIPTION

     "diff"  indicates which lines must be changed in order for	 file1
     and  file2	 to be identical.   If either  argument	 is  "-",  the
     standard input is used.   If either argument is a directory, then
     that  argument  refers to a file in the directory with  the  same
     filename  as the other argument.	The output of "diff" resembles
     lines of "ed" commands needed to convert file1 into file2.

     The  -b  option causes trailing blanks,  including	 tabs,	to  be
     ignored and other strings of blanks to compare equal.


     FILES


     SEE ALSO

     cmp(1), ed(1)


     DIAGNOSTICS

     Exit codes are:   0 for equal files,  1 for different files and 2
     for error conditions.




















				  - 218 -





     DU(1)						    DU(1)


     NAME

     du -- disk usage summary


     SYNOPSIS

     du [-s] [-a] [name ...]


     DESCRIPTION

     "du"  prints  the	number of blocks contained in  all  files  and
     directories  in each specified directory or file.	 If "name"  is
     missing,  "." is assumed.	With no options one entry is generated
     for  each directory;  -a causes an entry to be generated for each
     file; and -s causes only the total to be printed.

     A file with multiple links is only counted once.




































				  - 219 -





     ECHO(1)						    ECHO(1)


     NAME

     echo -- echo text


     SYNOPSIS

     echo text


     DESCRIPTION

     "echo"  writes its argument to the standard output.










































				  - 220 -





     ED(1)						    ED(1)


     NAME

     ed	 -- line oriented text editor


     SYNOPSIS

     ed [ - ] [ -x ] [ name ]


     DESCRIPTION

     ed is compatible with the standard line oriented UNIX text editor
     of the same name.

		    description of ed


     FILES


     SEE ALSO

     B. W. Kernighan, "A Tutorial Introduction to the ED Text Editor"


     DIAGNOSTICS




























				  - 221 -





     ET(1)						    ET(1)


     NAME

     et -- terminal emulation


     SYNOPSIS

     et [channel #]


     DESCRIPTION

     "et"  allows  the  user's terminal to connect  to  the  specified
     serial  channel (default channel 7) on the  NCUBE  system.   This
     permits the NCUBE system to act like a terminal on another system
     and allows file upload and download.   The following commands are
     invoked by typing the first letter of the command name.

	  binary file receive <filename>
	  connect to channel		   (↑space terminates command)
	  exe file send <filename>
	  file transfer <filename>
	  intel hex file receive <filename>
	  help
	  new channel <channel>
	  quit
	  receive into file <filename>
	  stty <options>		   (see STTY(1))
	  text file send <filename>

     To  download a file to the NCUBE system,  first type "r" followed
     by the filename where the downloaded file is to be stored.  Then,
     by  typing  "c",  the NCUBE terminal is connected  to  the  other
     system  and  downloading can be done by simply typing "cat  file"
     (assuming  the  other system can  understand  "cat").   Typing  a
     "↑space"  terminates  the  "connect  to  channel"  command.    To
     transfer  files  between  two NCUBES, you can use "file transfer"
     and "binary file receive" (the receive starts the transfer).

















				  - 222 -





     ET(1)                                                       ET(1)

          The  NCUBE  version  of the "intel hex format" breaks a file
     into  32  byte  blocks,   converts  each  byte   to   its   ascii
     representation  (two characters  per byte) and encapsulates it as
     shown below.   Given 32 bytes (e.g.  [F3,...,21])  then  the  hex
     format is

	 :20XXXX00F3...21Y  where everything is an ascii character and

	LL   = length in hex (20 except on the last block of a file)
	XXXX = offset of block in file (0,20,etc)
	Y    = checksum in hex (sum of all bytes including checksum=0)


     SEE ALSO

     stty(1)








































				  - 223 -





     F77(1)						    F77(1)


     NAME

     f77 -- Fortran 77 compiler


     SYNOPSIS

     f77 [option] ... file ...


     DESCRIPTION

     "f77"  is  the  Fortran  77  compiler.   Its  default  mode is to
     generate code for the 80286.  If one of the options is "-N"  then
     code  will  be  generated for the NCUBE node.  For details on the
     compiler and its options, see  the  Fortran  manual  from  Caine,
     Farber and Gordon.


     FILES


     SEE ALSO

     A	good  Fortran  77  Manual and the  ANSI	 standard  Fortran  77
     document.


     DIAGNOSTICS

     The f77 diagnostic messages are self-explanatory.
























				  - 224 -





     GREP(1)						    GREP(1)


     NAME

     grep -- search a file for a pattern


     SYNOPSIS

     grep [option] ... expression [file] ...


     DESCRIPTION

     "grep"  searches  the  input  files (the standard  input  is  the
     default)  for  a pattern of regular expressions in the  style  of
     ed(1).   The  default is to copy each line found to the  standard
     output.   If there is more than one input file and the -h  option
     is  not specified,  the file name is also shown.   Care should be
     taken in using special characters since some have meaning to  the
     shell.   It is safest to enclose the expression in single quotes.

     Options:

     -v	 All lines except those matching are printed.
     -c	 Only the count of matching lines is printed.
     -l	 The names of files with matching lines are listed.
     -n	 Each line is preceded by its line number in the file.
     -b	 Each line is preceded by the block number where it was
	 found.
     -s	 No output is produced.	 Only status is returned.
     -h	 Filename headers are not printed with output lines.
     -y	 Lower case letters in the pattern will match upper case
	 letters in the input.


     SEE ALSO

     ed(1), sh(1)


     DIAGNOSTICS

     Exit  status  is 1 is no matches are found;  0 if there  are  any
     matches; 2 if there are syntax errors of inaccessible files.












				  - 225 -





     HD(1)						    HD(1)


     NAME

     hd -- hex dump


     SYNOPSIS

     hd [-b] [-w] [-o #] [file] ...


     DESCRIPTION

     "hd"  dumps  the named files (standard input is default)  in  the
     format  specified  by  the first two options.   The  default  (no
     options)  or if "-b" is given,  is hex bytes.   The  "-w"  option
     causes the dump to be in hex halfwords (16 bits).  Dumping starts
     at  the byte offset specified by the "-o" argument (#) or at  the
     beginning if the "-o" option is omitted.

     "hd"  can be used with "ud" (in /usr/bin) to edit  binary  files.
     Use  "hd" to convert the file to a temporary text file,  edit the
     text  file and then use "ud" to convert it back to binary.   Even
     though the file resulting from "hd" has offsets and ascii on each
     side of the hex data, simply edit the hex (including deleting and
     adding data) and "ud" will convert back to  binary  ignoring  the
     offsets and ascii equivalents.


     SEE ALSO

     adb(1)
























				  - 226 -





     HELP(1)						    HELP(1)


     NAME

     help -- display the description of a command


     SYNOPSIS

     help [command] ...


     DESCRIPTION

     The descriptions of the named commands are displayed.   A list of
     all available commands is displayed if no operand is given.


     SEE ALSO

     man(1)




































				  - 227 -





     KILL(1)						    KILL(1)


     NAME

     kill -- terminate a process


     SYNOPSIS

     kill [-aptw] process # ...


     DESCRIPTION

     "kill"  sends  the specified signal ("t" is the default and  only
     one  signal  may  be specified) to  the  listed  processes.   The
     signals that may be sent are

	  -a:  abort ("↑C", can be trapped but if not, it is a kill)
	  -p:  pause
	  -t:  terminate (cannot be trapped, an absolute kill)
	  -w:  wake

     The  signalled processes must belong to the sender unless he  has
     superuser rights.


     SEE ALSO

     ps(1), psend(2), vector(2)



























				  - 228 -





     LN(1)						    LN(1)


     NAME

     ln -- create a link


     SYNOPSIS

     ln name1 name2


     DESCRIPTION

     "ln" creates a textual link, "name2", and stores it at "name1".


     SEE ALSO

     rmln(1)


     DIAGNOSTIC

     If "name1" already exists, an error is returned.
































				  - 229 -





     LOGOUT(1)						 LOGOUT(1)


     NAME

     logout -- log off system


     SYNOPSIS

     logout


     DESCRIPTION

     "logout"  closes all files and terminates all  processes attached
     to the terminal where it is issued.









































				  - 230 -





     LS(1)						    LS(1)


     NAME

     ls -- list directory contents

     SYNOPSIS

     ls [-lnst] name ...

     DESCRIPTION

     "ls"  lists the contents of each directory named and repeats  the
     name  and  other useful information about each named  file.   The
     output  is  sorted  alphabetically.  When no "name" is given, the
     current   directory  is  used.  The "-n" suppresses the output of
     headers for each block of files displayed.  If the "-t" option is
     given,    "ls"  lists  the entire tree,  including level numbers,
     for each  named directory.   The "-s"  (short format)  lists only
     names  while  the  "-l"  (long format) option adds the owner, the
     rights,  the  access  count   and  the  dates  created  and  last
     accessed to the short  "ls" format shown below.

       SYSTEM TYPE    FILE TYPE	   # BYTES    DATE ALTERED    NAME


     SEE ALSO

     hd(1)




























				  - 231 -





     MAIL(1)						    MAIL(1)


     NAME

     mail -- send or receive messages


     SYNOPSIS

     mail person ...
     mail [-r] [-q] [-p] [-f file]


     DESCRIPTION

     "mail"  with no arguments prints the user's mail in  LIFO  order.
     When  persons are named,  "mail" adds the standard input up to an
     EOF  (or a line with only ".") to each person's mail  file.   For
     each  message,  "mail"  reads a line from the standard  input  to
     direct its disposition.

     Direction:

     newline:  Go to the next message.
     d :  Delete the message and go on.
     p :  Print the message again.
     - :  Go back to the previous message.
     s [file] ... :  Save the message in the named files ("mbox" is
		     the default).
     w [file] ... :  Same as "s" but no header is saved.
     m [person] ... :  Mail the message to the named persons (the
		       user is the default).
     EOT (↑D):	Put unexamined mail back in the mailbox and stop.
     q :  Same as EOT.
     x :  Exit without changing the mailbox.
     !command:	Escape to the Shell to do command.
     ? :  Print a command summary.

     Options:

     -r	 Changes the order of mail to FIFO.
     -q	 Mail exits after interrupts without changing the mailbox.
     -p	 The messages are printed with no directives requested.
     -f	 The named file is printed as if it were the mail file.


     FILES


     SEE ALSO

     write(1)





				  - 232 -





     MAN(1)						    MAN(1)


     NAME

     man -- print sections of the manual


     SYNOPSIS

     man [options] [chapter] title ...


     DESCRIPTION

     "man"  prints the section named "title" in the named chapter  (if
     no  chapter  is named,  all occurrences of  title  are  printed).
     Options and chapter may be changed before each title.

     Options:

     ??????


     FILES


     SEE ALSO






























				  - 233 -





     MESG(1)						    MESG(1)


     NAME

     mesg -- permit or deny messages


     SYNOPSIS

     mesg [n] [y]


     DESCRIPTION

     "mesg"  with "n" forbids messages via write(1) while "y"  permits
     them.   With  no  parameters "mesg" reports the permission  state
     without  altering  it.   The  initial  permission  state  permits
     messages.	This command is executed directly by the shell.


     SEE ALSO

     write(1), sh(1)


     DIAGNOSTICS

     Exit  status 0 means messages are permitted;  1  means  they  are
     forbidden; 2 means an error condition exists.




























				  - 234 -





     MORE(1)						    MORE(1)


     NAME

     more -- display file in pages


     SYNOPSIS

     more [file] ...


     DESCRIPTION

     "more"  reads  each file in order and writes it to the   standard
     output.  For example

		    more file

     writes  "file" on the terminal screen (unless the standard output
     is not the terminal).  Each time 23 lines have been written   (or
     a    form  feed  is  encountered),   output  is  stopped  and   a
     continuation character is  requested  from  the  user.   A   <CR>
     causes   one  additional  line to be  output,  a  'space'  causes
     another  23  lines  to  be  output,   and  any  other   character
     causes "more" to terminate.

     If  no "file" is given or if the argument is  "-",  "more"  reads
     from the standard input.


     SEE ALSO

     cp(1), pr(1)























				  - 235 -





     MOUNT(1)						    MOUNT(1)


     NAME

     mount -- mount a file system


     SYNOPSIS

     mount device# ddirname


     DESCRIPTION

     "mount"  creates a ddir whose name is "ddirname"  and  points  to
     the device whose number is device#.  Currently device# must be 4,
     5,6 or 7.


     FILES



     SEE ALSO

     sysdev(5), mount(2)































				  - 236 -





     MV(1)						     MV(1)


     NAME

     mv -- move file or tree


     SYNOPSIS

     mv srcpath destpath


     DESCRIPTION

     "mv"  moves  the  file  or  tree  designated  by   "srcpath"   to
     "destpath".









































				  - 237 -





     NM(1)						    NM(1)


     NAME

     nm -- NCUBE screen editor (NMACS)


     SYNOPSIS

     nm -k keymap filename


     DESCRIPTION

     "nm"  is  the  EMACS  style NCUBE  screen  editor  (NMACS).   The
     optional keymap allows for user defined mapping of the  commands.
     The   commands  are  listed  below  in  the  form  of  a   keymap
     specification file including comments for command definition  and
     returned values.  The key sequences for invoking the commands are
     enclosed in apostrophes.   ("↑" preceding a key refers to holding
     down  the control key,  while  "E"  refers to an escape  sequence
     which  is  invoked  with an arrow key or a key  on  the  function
     keypad.)  For more details see section 5.3.1.2.1.


     Key     Name		     Description

     '↑@'    regionStart
     #
     #set start-of-region marker; always true
     #
     '↑A'    prevLine
     #
     #move cursor to start of previous line; false if on first line
     #
     '↑B'    endBuffer
     #
     #move cursor to end of buffer; false if buffer empty
     #
     '↑D'    deleteChar
     #
     #delete the character the cursor is on; false if at or beyond
     #the last character in the buffer
     #
     '↑E'    nextChar
     #
     #move cursor to the next character; false if at or beyond the
     #last character in the buffer
     #
     '↑F'    searchForward
     #
     #search forward; false if search string null or search fails





				  - 238 -





     '↑G'    endLine
     #
     #move cursor to end of current line; false if no newline is
     #found at or beyond cursor
     #
     '↑H'    deletePrevChar
     #
     #delete the character before the cursor; false if no character
     #is before the cursor
     #
     '↑I'    insertSelf
     #
     #insert current character at cursor; false if insertion would
     #extend the line beyond the editor's maximum line length
     #
     '↑J'    abortCommand
     #
     #cancel current command; always false
     #
     '↑K'    deleteRegion
     #
     #delete region between start and end markers; false if markers
     #are not set
     #
     '↑L'    deleteLine
     #
     #delete through end of current line; false if there is no
     #newline character at or beyond the cursor
     #
     '↑M'    insertSelf
     #
     #insert current character at cursor; false if insertion would
     #extend line beyond the editor's maximum line length
     #
     '↑N'    setSearchString
     #
     #set search string for current window; false if a search is
     #initiated and it fails
     #
     '↑P'    nextPage
     #
     #move cursor forward window size lines; false if end-of-buffer
     #is encountered
     #
     '↑Q'    abortCommand
     #
     #cancel current command; always false
     #
     '↑R'    refreshScreen
     #
     #redraw screen; always true
     #
     '↑S'    abortCommand
     #
     #cancel current command; always false



				  - 239 -





     '↑T'    startBuffer
     #
     #move cursor to beginning of buffer; false if buffer is empty
     #
     '↑U'    prevPage
     #
     #move cursor backward window size lines; false if
     #start-of-buffer is encountered
     #
     '↑V'    startLine
     #
     #move cursor to beginning of current line; false if buffer empty
     #
     '↑W'    prevChar
     #
     #move cursor backward one character; false if at start of buffer
     #
     '↑X↑A'  addWindow
     #
     #add a window to the display for a specified buffer; false if
     #there are already four windows or if buffer is empty
     #
     '↑X↑D'  deleteWord
     #
     #delete word or white space under cursor (Not Yet Implemented)
     #
     '↑X↑F'  searchBackward
     #
     #search backward; false if search fails or search string is null
     #
     '↑X↑G'  editFile
     #
     #edit a specified file in a specified buffer; false if buffer is
     #not empty or if filename string is null
     #
     '↑X↑H'  abortCommand
     #
     #cancel current command; always false
     #
     '↑X↑I'  insertArg
     #
     #insert argument string into buffer; false if string is null
     #
     '↑X↑J'  abortCommand
     #
     #cancel current command; always false
     #
     '↑X↑K'  killWindow
     #
     #remove current window from display; false if only one window
     #
     '↑X↑L'  insertLine
     #
     #start a new line before the current position; always true




				  - 240 -





     '↑X↑N'  nextWindow
     #
     #move cursor to next window on display; false if only one window
     #
     '↑X↑P'  copyRegionToBuffer
     #
     #copy current region to a specified buffer; false if buffer is
     #associated with a file or if markers are not set
     #
     '↑X↑R'  copyBuffer
     #
     #copy contents of specified buffer to current position; false if
     #buffer is empty
     #
     '↑X↑T'  setPosition
     #
     #move cursor to specified character position; false if the
     #character position is after the last character in buffer
     #
     '↑X↑U'  undo
     #
     #undo last command if possible (Not Yet Implemented)
     #
     '↑X↑X'  abortCommand
     #
     #cancel current command; always true
     #
     '↑X↑Z'  saveAndExit
     #
     #write modified file buffers and exit editor; no return
     #
     '↑X↑'  exitNoSave
     #
     #exit editor without writing file(s); no return
     #
     '↑X↑]'  saveAndExit
     #
     #write modified file buffers and exit editor; no return
     #
     '↑X9'   macroExecute
     #
     #execute the current key macro command; the returned value
     #is that returned by the last command executed in the macro
     #
     '↑X8'   macroExecute
     '↑X7'   macroExecute
     '↑X6'   macroExecute
     '↑X5'   macroExecute
     '↑X4'   macroExecute
     '↑X3'   macroExecute
     '↑X2'   macroExecute
     '↑X1'   macroExecute
     '↑X0'   macroExecute





				  - 241 -





     '↑X]'   macroEnd
     #
     #end definition of the key macro command; false if a macro
     #definition is not active
     #
     '↑X['   macroBegin
     #
     #begin definition of the key macro command; always true
     #
     '↑Xa9'  pushArg
     #
     #push an argument of the current level; false if the
     #argument is null
     #
     '↑Xa8'  pushArg
     '↑Xa7'  pushArg
     '↑Xa6'  pushArg
     '↑Xa5'  pushArg
     '↑Xa4'  pushArg
     '↑Xa3'  pushArg
     '↑Xa2'  pushArg
     '↑Xa1'  pushArg
     '↑Xa0'  pushArg
     #
     '↑Xb'   listBuffers
     #
     #list buffers; always true
     #
     '↑Xc'   copyRegion
     #
     #insert contents of current region before cursor; false if
     #the region markers are not set
     #
     '↑Xdm'  macroDisplay
     #
     #insert key macro text in current buffer; always true
     #
     '↑Xh'   help
     #
     #enter editor help mode; false if last keymap file specified
     #was not read successfully
     #
     '↑Xi'   addReg
     #
     #add argument values; false if the argument list is empty or the
     #specified registers are not marked as numeric












				  - 242 -





     '↑Xl9'  loadReg
     #
     #load a value into a register; always true
     #
     '↑Xl8'  loadReg
     '↑Xl7'  loadReg
     '↑Xl6'  loadReg
     '↑Xl5'  loadReg
     '↑Xl4'  loadReg
     '↑Xl3'  loadReg
     '↑Xl2'  loadReg
     '↑Xl1'  loadReg
     '↑Xl0'  loadReg
     #
     '↑Xn'   setFileName
     #
     #set default file name for current buffer; false if buffer has
     #a null filename or if the specified filename is null
     #
     '↑Xo'   suppressUpdate
     #
     #suppress display update; always true
     #
     '↑Xp'   pauseEdit
     #
     #suspend editor; always true
     #
     '↑Xr9'  pushReg
     #
     #push a register as an argument; always true
     #
     '↑Xr8'  pushReg
     '↑Xr7'  pushReg
     '↑Xr6'  pushReg
     '↑Xr5'  pushReg
     '↑Xr4'  pushReg
     '↑Xr3'  pushReg
     '↑Xr2'  pushReg
     '↑Xr1'  pushReg
     '↑Xr0'  pushReg
     #
     '↑Xs'   writeDefaultFile
     #
     #write current buffer to default filename; false if buffer has
     #null filename or if buffer has not been modified
     #
     '↑Y'    regionEnd
     #
     #set end-of-region marker; always true
     #
     '↑Z'    nextLine
     #
     #move cursor to beginning of next line; false if on last line





				  - 243 -





     'E[D'  prevChar
     #
     #move cursor backward one character; false if at start of buffer
     #
     'E[C'  nextChar
     #
     #move cursor to the next character; false if at or beyond last
     #character
     #
     'E[B'  nextLine
     #
     #move cursor to beginning of next line; false if on last line
     #
     'E[A'  prevLine
     #
     #move to beginning of previous line; false if on first line
     #
     'EOS'  newKeymap
     #
     #read a new keymap from a file (PF1)
     #
     'EOQ'  help
     #
     #enter editor help mode; false if last keymap file specified was
     #not read successfully (PF2)

































				  - 244 -





     'EOP'  doCommand
     #
     #execute a command by name (Not Yet Implemented) (PF3)
     #
     'EOM'  macroZero
     #
     #execute key macro zero; the returned value is that returned by
     #the last command executed in the macro (ENTER)
     #
     'EOq'  macroExitFail
     #
     #exit a key macro if last command failed; false if invoked from
     #the keyboard (FK1)
     #
     'EOp'  macroExitOK
     #
     #exit a key macro if last command succeeded; false if invoked
     #from the keyboard (FK0)
     #
     'EOl'  setRepeatCount
     #
     #set repeat count for next command; always true (FK,)
     #
     '↑'    exitNoSave
     #
     #exit editor without writing file(s); no return
     #
     '↑]'    saveAndExit
     #
     #write modified file buffers and exit editor; no return




























				  - 245 -





     '↑↑'    copyRegion
     #
     #insert contents of current region before cursor; false if
     #region markers are not set
     #
     ' '-'?' insertSelf
     #
     #insert current character at cursor; false if insertion would
     #extend the line beyond the editor's maximum line length
     #
     '@'-'←' insertSelf
     '`'-'r' insertSelf














































				  - 246 -





     NSH(1)						    NSH(1)


     NAME

     nsh -- NCUBE shell


     SYNOPSIS

     nsh [param] ...


     DESCRIPTION

     "nsh" is the same as "sh" and is described in the sh(1) section.










































				  - 247 -





     PASSWD(1)						    PASSWD(1)


     NAME

     passwd -- change logon password


     SYNOPSIS

     /sys/bin/edusr


     DESCRIPTION

     "/sys/bin/edusr"  must be used by a superuser to change a  user's
     password.   A new password is installed by first typing "c"  (for
     "change password for user") followed by the username.   Then  the
     new password is entered.


     FILES

     /sys/acct


     SEE ALSO

     section 6.2.6





























				  - 248 -





     PR(1)						    PR(1)


     NAME

     pr -- print file


     SYNOPSIS

     pr [-pec] [-dl] [-f] [file] ...


     DESCRIPTION

     "pr" prints the named files (if no files are named it prints  the
     standard  input).	The meaning of the options is given below.

	  -p:  pica	  (10 char/inch)  |
	  -e:  elite	  (12 char/inch)  |-- only one option can be
	  -c:  compressed (17 char/inch)←←|   given; "p" is default
				 ←←←←
	  -d:  data mode   (fast)    |-- only one option can be given
	  -l:  letter mode (slower)←←|	 and "d" is the default

	  -f:  formatted (output is printed with a header; the default
			  is unformatted output)

     All   files   that  are  waiting  to  be  printed  are   put   in
     /usr/spool/lpt.   The  files that have been printed are found  in
     /sys/spool.log  and,  unless the printer is idle,  the last  file
     given is currently being printed.  If the printer is offline, the
     warning "printer offline" is written to the standard error.

     In  order to kill a print job,  first kill the  spooler  process,
     then   remove  the  file  being   printed  from  the    directory
     "/usr/spool/lpt"  and  finally,  restart the  spooler  by  typing
     "/sys/startup".


     FILES

     /usr/spool/lpt, /sys/spool.log, /sys/startup


     SEE ALSO

     cat(1)










				  - 249 -





     PS(1)						    PS(1)


     NAME

     ps -- process status


     SYNOPSIS

     ps [-a]


     DESCRIPTION

     "ps" prints status information about active processes.   The "-a"
     option causes all processes to be reported on;  the default is to
     describe only the processes owned by the caller.   The format  is
     given below.  (SCC is equivalent to TTY.)


	 ID	PRIORITY     STATUS	CPU TIME     SCC     NAME


     The  CPU TIME is the cumulative time of all terminated  processes
     that were created by the given process.

     If  the  "-a" option is given,  the owner is added to  the  above
     format.


     SEE ALSO

     procobj(5)
























				  - 250 -





     PSTAT(1)						    PSTAT(1)


     NAME

     pstat -- print system status


     SYNOPSIS

     pstat


     DESCRIPTION

     "pstat" displays system status in the following format.


	  system status at:  (date and time)

	  system created at:  (date and time)
	  system last up at: (date and time)
	  system started at:  (date and time)

	  System ID: (backplane number)
	  Board ID:  (slot number of Host Board)

			Current (this startup)	Total (since creation)
	  Up time	(seconds)		(seconds)
	  Overhead time
	  Idle time
	  Ecc errors	(corrected)		(corrected)
	  Array time
	  Intr errors

	      # C - intake temp
	      # C - exhaust temp
	      #	 of nodes in use
	      #	 active processes
	      #	 system crashes



     SEE ALSO

     sysdata(5), ps(1)












				  - 251 -





     PWD(1)						    PWD(1)


     NAME

     pwd -- print name of current working directory


     SYNOPSIS

     pwd


     DESCRIPTION

     "pwd"  prints the pathname of the current working directory.   It
     is executed directly by the shell.


     SEE ALSO

     cd(1), sh(1)




































				  - 252 -





     RM(1)						    RM(1)


     NAME

     rm -- remove files and directories
     rmln -- remove links


     SYNOPSIS

     rm name
     rmln name

     DESCRIPTION

     "rm" removes the named file or directory (a directory can only be
     removed if it is empty).  If the named entity is a link, the file
     or  directory it refers to is removed and the link remains.   The
     "rmln"  command  removes the actual link named  rather  than  the
     entity it refers to.


     SEE ALSO
     ln(1)

































				  - 253 -





     SA(1)						    SA(1)



     NAME

     sa, accton -- system accounting


     SYNOPSIS

     sa [-abcjlnrstuv] [file]
     /etc/accton [file]


     DESCRIPTION

     Not Yet Implemented


     FILES


     SEE ALSO

     acct(2)
































				  - 254 -





     SED(1)						    SED(1)


     NAME

     sed -- stream editor


     SYNOPSIS

     sed [-n] [-e script] [-f file] [file] ...


     DESCRIPTION

     "sed"  edits the named files (the default is the standard  input)
     according  to  a script of commands and puts the  result  in  the
     standard output.  Not Yet Implemented.



     SEE ALSO

     ed(1), grep(1), nmacs(1)


































				  - 255 -





     SH(1)						    SH(1)


     NAME

     sh, nsh -- NCUBE shell or command interpreter


     SYNOPSIS

     sh [param] ...


     DESCRIPTION

     "sh"  (or "nsh") is a command interpreter that executes  commands
     from  a terminal or a file.   For all executable commands  except
     those listed below as "shell commands",  the shell searches a set
     of  directories (PATH) for the command and runs the command as  a
     new process (see frun(2)).   If the command given to the shell is
     a text file,  a new shell is started and the contents of the file
     are  treated  as  commands.   The  facilities of  the  shell  are
     summarized below.


     Shell Variables

	  PATH:	 path contains a set of directories separated by
	       spaces that defines the order of search the shell makes
	       when given a command.  The default is

				". /bin /usr/bin"

	  HOME:	 home is the name of the default directory.  Unless
	       set (see below), home is the current directory.

	  PROMPT:  prompt is the character printed by the shell to
	       signify that it is ready for user input.	 The default
	       is ".".

	  META:	 meta is the character used by the shell to signify
	       the value of a reserved word.  The default is "↑".


     Shell Parameters

	  ↑0:  denotes the command itself
	  ↑1:  denotes the first parameter
	  ↑n:  denotes the nth parameter (0<n<10)









				  - 256 -





     SH(1)						    SH(1)



     Shell Commands

	  alias [text command]:	 If the operand is missing, all
	       currently "aliased" commands are printed.  Otherwise,
	       the specified command including any listed options is
	       given "text" as another name.

	  bg #:	 Make process # active in background and keep shell
	       alive.

	  cd [dirname]:	 Change current directory to "dirname" if it
	       (HOME is default).  If "dirname" does not exist an
	       error is returned.

	  eval filename:  Take standard input from the named file and
	       treat it as if it had been typed at the terminal.

	  exit:	 Kill the shell.

	  fg #:	 Make process # the active process and suspend the
	       shell.

	  mesg [p]:  Set message permission (p=y or p=n); permission
	       is initially "y".

	  pwd:	Print working (current) directory.

	  set [var text]:  If the operand is missing, all current
	       settings of the variables are printed.  Otherwise, the
	       specified shell variable ("var") is set to "text".

	  shut #:  Clean up and shut down the disk operating system in
	       # minutes (default is 5) and invoke the RAM Monitor
	       (must be superuser).




















				  - 257 -





     SH(1)						    SH(1)


     Shell Functions:

	  ↑z:  This is the "end of file" designator.  It also kills
	       the shell.  It has the function of "↑d" in Unix.

	  ↑r:  Retype the line.

	  ↑u:  Delete the line.

	  @:  The next character is quoted (same as "" in Unix).

	  '...':  All characters between two single quotes, except a
	       single quote, are quoted (same as Unix).	 To quote a
	       single quote, use @.

	  "...":  Same as single quotes except that command and
	       parameter substitutions occur (same as Unix).

	  ~:  Shorthand for HOME.

	  ;:  A semicolon (;) is used to separate commands and cause
	      sequential execution.

	  < file:  The named file is used as the standard input.

	  > file:  The named file is used as the standard output.  If
	       it does not exist, then it is created.  Otherwise, it
	       is first truncated to zero length.

	  >> file:  The named file is used as the standard output.
	       If the file exists then the output is appended;
	       otherwise, the file is created.

	  |:  The bar (|) joins two commands with a pipeline (the
	       standard output of the first command is the standard
	       input of the second).  The commands are run
	       concurrently.

	  &:  The ampersand (&) causes the commands or pipelines to
	       its left on the line to begin execution and
	       immediately returns to allow the shell to run
	       concurrently with the command line.


     Automatic Login Commands:

	  If the file "login" exists in the user's initial login
	  directory, then the shell runs it as a command file.







				  - 258 -





     SH(1)						    SH(1)



     Future Shell Facilities

	  Wild Card Characters including ↑*



     FILES

     /bin, /usr/bin


     SEE ALSO

     cd(1), mesg(1), pwd(1), write(1), frun(2)








































				  - 259 -





     SHUT(1)						    SHUT(1)


      NAME

     shut -- invoke RAM Monitor


     SYNOPSIS

     shut [minutes]


     DESCRIPTION

     "shut"  shuts  down the operating system  (terminates  processes,
     closes  files  and cleans up file systems) and  invokes  the  RAM
     Monitor  (see  5.2.4).   The message given is  "NCUBE  Diagnostic
     Monitor".  The shutdown occurs after the number of minutes  given
     in  the argument (default is 5).  Only a superuser may issue  the
     "shut" command.


     SEE ALSO

     syshut(2)
































				  - 260 -





     SLEEP(1)						    SLEEP(1)


     NAME

     sleep -- suspend execution for an interval


     SYNOPSIS

     sleep [time]


     DESCRIPTION

     "sleep" suspends execution for "time" seconds.   The  default  is
     zero and the limits are 0 to 65,535.


     SEE ALSO

     alarm(2)




































				  - 261 -





     SORT(1)						    SORT(1)


     NAME

     sort -- sort or merge files


     SYNOPSIS

     sort [-mubdfinrtx] [+pos1 [-pos2] ] ... [-o name] [-T directory]
     [name] ...


     DESCRIPTION

     "sort"  writes on the standard output the result of sorting lines
     of all the named files together.


     FILES


     SEE ALSO


     DIAGNOSTICS































				  - 262 -





     SPLIT(1)						    SPLIT(1)


     NAME

     split -- split a file


     SYNOPSIS

     split [-n] [file [name] ]


     DESCRIPTION

     "split" writes "file" in "n" (default 1000) line pieces,  as many
     as necessary,  in a set of output files.   The name of the  first
     output file is "name" (default "x") with "aa" appended, and so on
     lexicographically.   If  no  input file is given (or  - is  given
     instead) then the standard input is used.






































				  - 263 -





     STTY(1)						    STTY(1)


     NAME

     stty -- set terminal options


     SYNOPSIS

     stty [option ...]


     DESCRIPTION

     "stty"  sets various I/O options on the current output  terminal.
     With  no  options it reports the current settings of the options.

     Options (followed by permissible settings):

	  -abort  {enable|disable|<char>}
	  -baud	  {50|75|110|134|150|200|300|600|1200|1800|2400|4800|
		   9600|19200}
	  -bits	  {5|6|7|8}
	  -cancel {enable|disable|<char>}
	  -cts	  {enable|disable}
	  -modem  {enable|disable}
	  -NLmap  {enable|disable}
	  -out	  {enable|disable}
	  -parity {enable|disable|even|odd}
	  -reset  (clears buffers; resets flags; sets channel idle)
	  -rts	  {0|1}
	  -stop	  {1|2}
	  -tty	  {0|1|2|3|4|5|6|7}
	  -xoff	  {<char>}
	  -xon	  {<char>}

	       where  <char>={[↑]<ch>}	and

		      <ch>={A...Z,a...z,0...9,etc}



     For example,  in order to set the baud rate of channel 3 to 9600,
     type

		    stty -tty 3 -baud 9600



     SEE ALSO

     sh(1)





				  - 264 -





     TAIL(1)						     TAIL(1)


     NAME

     tail -- display the end of a file


     SYNOPSIS

     tail [-b bytecnt] [-l linecnt] [file]


     DESCRIPTION

     "tail" copies the end of the named file (if missing the  standard
     input  is  used)  to the standard output.  The default is to copy
     the last 10 lines.  The options are:   "-b  bytecnt"  copies  the
     last  "bytecnt"  bytes;  "-l  linecnt"  copies the last "linecnt"
     lines.  In all cases the limit is 16000 characters.






































				  - 265 -





     TBR(1)						    TBR(1)


     NAME

     tbr -- tape backup and restore


     SYNOPSIS

      tbr [-acilnpqsuw] [-d sector#] [-b or -r {name1 [as name2]}...]


     DESCRIPTION

     "tbr"  initializes  tapes,  backs up files on tape  and  restores
     files from tape.  If "name1" is a directory, the entire tree will
     be backed up or restored.   When backing up,  "name1" is the name
     in  the disk system while the optional "name2" is the name on the
     tape.   When restoring,  "name1" is the name on the tape and  the
     optional "name2" is the name in the disk system.   In both cases,
     if "name2" is omitted, "name1" is used.

     The options are

	  -a:  append on backup
	  -c:  certify tape (erases; usually done once; takes 1 hour)
	  -i:  initialize tape drive (should only be used if tape
	       system seems to be confused)
	  -l:  list tape directory
	  -n:  restore with current date and owner (default both old)
	  -p:  protect existing files on restore
	  -q:  must be used (with -c) to certify quarter-sized tapes
	  -s:  display tape status
	  -u:  unload tape when done
	  -w:  waits for tape load (up to 5 minutes)
	  -d sector#: display tape sector (0 to 65536)
		      ←←←
	  -b:  backup	 | Only one of these options can be given;
	  -r:  restore←←←| restore can only be applied to one name.


     The options are performed in the order: w,i,s,c,d,(b or r),l,u

     An example "tbr" command is

	       tbr -aluw -b file1 as file2

     This  command  will  backup "file1" on the  tape  with  the  name
     "file2", display the new tape directory and unload the tape.


     SEE ALSO

     RAM Monitor (tape commands)



				  - 266 -





     TEE(1)						    TEE(1)


     NAME

     tee -- data transmission with filing


     SYNOPSIS

     tee [file] ...


     DESCRIPTION

     "tee"  transmits  the standard input to the standard  output  and
     makes copies in the named files.









































				  - 267 -





     WAIT(1)						    WAIT(1)


     NAME

     wait -- wait for process completion


     SYNOPSIS

     wait


     DESCRIPTION

     Wait  until  all  processes started with "&" have  completed  and
     report on abnormal termination.   The wait(2) system call must be
     executed  in  the  parent process so the  Shell  itself  executes
     "wait" without creating a new process.


     SEE ALSO

     sh(1)


































				  - 268 -





     WALL(1)						    WALL(1)


     NAME

     wall -- write to all users


     SYNOPSIS

     wall text


     DESCRIPTION

     "wall"  sends  text  as  a  message   (appended  with  "Broadcast
     Message  ...") to all logged in users.   The sender  should be  a
     superuser  to ensure that all users receive the message.   If the
     terminal  user has forbidden messages, "wall" from a user who  is
     not a superuser will not be displayed.


     SEE ALSO

     mesg(1), write(1)

































				  - 269 -





     WHO(1)						    WHO(1)


     NAME

     who -- who is on the system


     SYNOPSIS

     who


     DESCRIPTION

     "who"  lists all the logged on users.   It displays an "*" before
     the name of the user who invoked "who".   For all users who  have
     permitted messages,  "who" displays the process number to be used
     in the "write" command for sending text.


     SEE ALSO

     write(1)


































				  - 270 -





     WRITE(1)						    WRITE(1)


     NAME

     write -- write to another user


     SYNOPSIS

     write process# text


     DESCRIPTION

     "write"  copies  "text" from your terminal to the named  process.
     The appropriate process number to use is obtained from the  "who"
     command.   The  "mesg" command is used to allow or deny messages.
     The default when the shell is started is to allow messages.


     SEE ALSO

     mesg(1), who(1), mail(1), sh(1)


































				  - 271 -





     5.3.2.2  System Calls


     This section specifies the calls that can be made directly on the
     operating system.  All other system facilities are based on these
     calls.  The system calls are listed below.

	  ALARM:    schedule signal (89)
	  CHDIR:    change working directory (91)
	  CHFIL:    change file type (124)
	  CHNAME:   change filename (119)
	  CHPROT:   change protection (92)
	  CLOCK:    read or convert time (116)
	  CORE:	    allocate memory (90)
	  ENDPCS:   terminate process (98)
	  ENDUMP:   dump and terminate process (99)
	  FCLOSE:   close file (94)
	  FCREATE:  create file (95)
	  FDEL:	    delete file (117)
	  FINFO:    return open file information (18)
	  FLKUP:    look up name (88)
	  FMOUNT:   mount file structured device (109)
	  FMV:	    move file or tree (19)
	  FOPEN:    open file (111)
	  FREAD:    read file (114)
	  FRUN:	    run file (97)
	  FSEEK:    move file pointer (108)
	  FSHARE:   share allocated subcube (125)
	  FUNMNT:   unmount file structured device (110)
	  FWRITE:   write file (118)
	  GETDSK:   get disk status (102)
	  GETID:    get process and system ID (96)
	  GETLST:   get list of known systems (106)
	  GETPCS:   get process status (100)
	  GETSYS:   get system status (101)
	  MKDDIR:   make device directory pointer (ddir) (107)
	  MKLNK:    make link (105)
	  MKPIP:    make pipe (113)
	  MULTIWAIT:wait on multiple sources for input (127)
	  PAUSE:    suspend process (112)
	  PSEND:    send signal (104)
	  SETPCS:   set process parameters (122)
	  SHARE:    share segment with another process (93)
	  SLEEP:    suspend process for n seconds (123)
	  SPECIAL:  special operations (103)
	  SYSHUT:   clean up system and invoke RAM Monitor (120)
	  UNCORE:   release segment in process LDT (126)
	  VECTOR:   set interrupt vectors (115)
	  WAKE:	    wake up process (121)

     The  "SYNOPSIS"  sections below are a shorthand for  listing  the
     name  and  parameters of the calls.   They do not  represent  the
     calling  convention for any particular language.   The manual for
     the  language in question will document its conventions  for  the
     system calls.



				  - 272 -





     One   common  error  is  to  incorrectly  specify  name  strings.
     Wherever a "name string" is referred to,  it must be a blank, tab
     or  null terminated string of up to 24 ascii characters from  the
     set

			  {A-Z,a-z,0-9,.,←,$}

     The "name" string for "frun" is slightly different (see FRUN(2)).


     There  are  numerous error conditions and rather than  list  them
     with each call,  they are all collected below.   The error number
     is returned in the ax register when there is an error.  The error
     message  for  each error is contained in a  separate  file.   The
     error  message  directory is "/sys/sysmsg" and the name  of  each
     file is its error number (e.g. /sys/sysmsg/ff01).

	  FF01	 LKPFNF	   File not found
	  FF02	 LKPICH	   Invalid channel number
	  FF03	 LKPBDN	   Invalid pathname
	  FF04	 LKPBDIR   Bad directory format
	  FF05	 LKPNOPN   Open table full
	  FF06	 LKPNRT	   No rights for lookup
	  FE01	 GTBINX	   Bad segment to "getbuf"
	  FD01	 OPNFNF	   File not found
	  FD02	 OPNFNR	   No rights to open file
	  FD03	 OPNBDIR   Bad directory format
	  FD04	 OPNLCKD   File locked
	  FC01	 TTYINU	   TTY device in use
	  FC02	 TTYNINU   TTY device not in use
	  FC03	 TTYBSPC   Invalid TTY special function
	  FB01	 PIPMTY	   Pipe one sided
	  FA01	 DSKNON	   Access to nonexistant disk
	  FA02	 DSKINVA   Access to bad disk address
	  FA03	 DSKFTL	   Disk fatal error
	  FA04	 DSKFUL	   Disk full error
	  FA05	 DSKBSPC   Invalid disk special function
	  F901	 PRTBSY	   Printer busy
	  F902	 PTRBSPC   Invalid printer special function
	  F801	 MNMNUL	   Null field in pathname
	  F802	 MNMBDC	   Invalid character in pathname
	  F803	 MNMTLG	   Pathname too long
	  F701	 DEVERR	   Invalid operation for device
	  F601	 NOMEM	   No space for memory request
	  F501	 FRNNSP	   No space for new process
	  F502	 FRNNEX	   Not an executable file
	  F401	 FRDBDR	   Bad directory format
	  F402	 FRDEOF	   Read end of file
	  F403	 FRDNRT	   No rights for read









				  - 273 -





	  F301	 FCRNFL	   Attempt to replace non-file
	  F302	 FCRIVT	   May not create file type
	  F303	 FCRNRT	   No rights for file create
	  F304	 FCRFEX	   Replacing existing file
	  F201	 FDLFNF	   File not found
	  F202	 FDLNRT	   No rights for delete
	  F203	 FDLBDR	   Bad directory format
	  F204	 FDLNEM	   Directory not empty
	  F101	 FSKOVR	   Seek off end of file
	  F102	 FSKBDR	   Bad directory format
	  F001	 TIMIFC	   Invalid timer function
	  EF01	 GPSNFD	   Process for status not found
	  EE01	 GDKBDK	   Disk for status not present
	  ED01	 SPCSBD	   Process initialization error
	  EC01	 WAKBST	   Bad status (<64) to wake
	  EB01	 FWRBDR	   Bad directory format
	  EB02	 FWRNRT	   No rights for write
	  EA01	 MKLNRT	   No rights for create link
	  EA02	 MKLBDN	   Bad character in link string
	  EA03	 MKLFEX	   File already exists
	  E901	 CHDBDN	   Bad character in "chdir" name
	  E801	 MKPNOPN   No open block for "mkpip"
	  E701	 MKDNRT	   No rights to make ddir
	  E702	 MKDFEX	   Attempt to replace object
	  E703	 MKDIVD	   Invalid device for ddir
	  E601	 PSNNPS	   No process for ID
	  E602	 PSNBSG	   Invalid signal number
	  E603	 PSNREF	   Message refused
	  E604	 PSNNRT	   No rights to send signal
	  E501	 VECBSG	   Invalid vector number
	  E401	 SHRNFD	   Process not found
	  E402	 SHRNRT	   No rights for share
	  E403	 SHRBNX	   Invalid LDT index
	  E404	 SHRBSG	   Invalid segment for share
	  E405	 FSHNFL	   Invalid file to share
	  E301	 SHTNRT	   No right to shutdown system
	  E201	 TAPBSY	   Tape drive busy
	  E202	 TAPBSPC   Invalid special operation to tape
	  E203	 TAPTIMO   Tape operation timeout
	  E101	 CHNFEX	   Result name already exists
	  E001	 BUSBSY	   Bus device busy
	  E002	 BUSBSPC   Invalid special operation
	  DF01	 ARYBSY	   Array device busy
	  DF02	 ARYBSPC   Invalid special operation
	  DF03	 ARYERW	   Write message failed
	  DF04	 ARYBND	   Invalid node referenced
	  DE01	 FSPBSPC   Invaled special operation
	  DE02	 FSPNRT	   No rights for special operation
	  DD01	 OPTBSY	   Optional SBX device busy
	  DD02	 OPTBSPC   Invalid special operation








				  - 274 -





     ALARM(2)						    ALARM(2)


     NAME

     alarm -- schedule signal after specified time


     SYNOPSIS

     alarm(seconds)


     DESCRIPTION

     "alarm"  causes the SIGALRM signal (see VECTOR(2)) to be sent  to
     the  calling process after time given by "seconds".   The process
     is terminated unless the signal is caught.

     Successive calls to alarm reset the alarm clock and if  "seconds"
     is 0, any pending alarm request is cancelled.

     The  returned  value  is  the amount of  time  remaining  in  the
     previous setting of the alarm clock.


     SEE ALSO

     pause(2), vector(2)


     ASSEMBLER

     alarm = 89

     entry:
     ax = seconds

     int alarm

     exit:
     carry = 1 if error
     ax = previous amount of time remaining if no error or
	  error number if error
     all other registers saved













				  - 275 -





     CHDIR(2)						    CHDIR(2)


     NAME

     chdir -- change current working directory


     SYNOPSIS

     chdir(dirname)


     DESCRIPTION

     "chdir"  makes  "dirname" the current working directory  (of  the
     calling  process) which is the starting point for pathnames  that
     do not begin with "/".  "dirname" is the address of a pathname of
     a directory.


     SEE ALSO

     cd(1)


     DIAGNOSTICS

     An	 error is returned if the process does not have the  necessary
     rights.


     ASSEMBLER

     chdir = 91

     entry:
     es = segment selector for "dirname" string
     bx = segment offset for "dirname" string

     int chdir

     exit:
     carry = 1 if error
     ax = error number if error
     all other registers saved












				  - 276 -





     CHFIL(2)						    CHFIL(2)


     NAME

     chfil -- change the type of a file


     SYNOPSIS

     chfil(type,owner,date,name)


     DESCRIPTION

     "chfil"  changes  the  type, owner and date of the file "name" to
     "type",  "owner"  and  "date",  repectively.   If  any   of   the
     parameters are zero, they are left unchanged.


     SEE ALSO

     chname(2), chprot(2)


     DIAGNOSTICS

     An error is returned if "name" does not exist.


     ASSEMBLER

     chfil = 124

     entry:

     ax = "type" (new type if non-zero)
     cx = "owner" (new owner if non-zero)
     di:dx = "date" (new date if non-zero)
     ex = segment selector for "name" string
     bx = segment offset for "name" string (file or directory)

     int chfil

     exit:

     ax = error number if error
     carry = 1 if error
     all other registers saved









				  - 277 -





     CHNAME(2)						    CHNAME(2)



     NAME

     chname -- change the name of a file


     SYNOPSIS

     chname(newname,oldname)


     DESCRIPTION

     "chname"  changes  the name of "oldname" in the  current  working
     directory to "newname".


     SEE ALSO

     chdir(2)


     DIAGNOSTICS

     An	 error is returned if "oldname" does not exist or if "newname"
     does.


     ASSEMBLER

     chname = 119

     entry:
     ds = segment selector for "newname" string
     ax = segment offset of "newname" string
     es = segment selector for "oldname" string
     bx = segment offset of "oldname" string

     int chname

     exit:
     carry = 1 if error
     ax = error number if error
     all other registers saved











				  - 278 -





     CHPROT(2)						    CHPROT(2)


     NAME

     chprot -- change file protection parameters


     SYNOPSIS

     chprot(clearrights,setrights,name)


     DESCRIPTION

     "chprot"  clears the "clearrights" bits and sets the  "setrights"
     bits in the rights field of the last component of "name".  "name"
     can  be the pathname of a file or a directory.   The process must
     have sufficient rights to change the parameters.


     SEE ALSO

     dir(5), file(5)


     DIAGNOSTICS

     If  the  process has insufficient rights or "name" is an  invalid
     name, an error is returned.


     ASSEMBLER

     chprot = 92

     entry:
     ax = "clearrights" (rights bits to be cleared)
     cx = "setrights" (rights bits to be set)
     es = segment selector for "name" string
     bx = segment offset for "name" string

     int chprot

     exit:
     carry = 1 if error
     ax = error number if error
     all other registers saved










				  - 279 -





     CLOCK(2)						    CLOCK(2)


     NAME

     clock -- read or convert time


     SYNOPSIS

     clock(func,timenam,timeval)


     DESCRIPTION

     If  "func" = 0 then "clock" reads the system time and returns  it
     as  a  32  bit value ("timeval").   If "func" =  1  then  "clock"
     converts the value in "timeval" to a text string in the format

			 dd-mmm-yy hh:mm:ss0

     and stores it at the location addressed by "timenam".


     DIAGNOSTICS

     An error is returned if the value of "func" is out of range.


     ASSEMBLER

     clock = 116

     entry:
     ax = "func" (function indicator)
     cx = "timeval" (low order part)
     dx = "timeval" (high order part)
     es = segment selector for "timenam" string
     bx = segment offset for "timenam" string

     int clock

     exit:
     carry = 1 if error
     ax = error number if error
     cx = time value (low order part)
     dx = time value (high order part)
     all other registers saved










				  - 280 -





     CORE(2)						      CORE(2)


     NAME

     core -- memory allocation


     SYNOPSIS

     core(len,seg)


     DESCRIPTION

     "core"  is used to allocate memory in the local address space  of
     the  process.   If "seg" is the index of a valid  segment in  the
     LDT  of the process then the indicated segment is set  to  length
     "len" (the segment size can be increased or decreased by "core").
     If  "seg" is the index of an invalid segment,  then a new segment
     is created in the LDT at that index.  If "seg" indexes beyond the
     LDT,  then the LDT is expanded and a new segment of length  "len"
     is  allocated and its selector is entered in the LDT in the  slot
     indexed by "seg".


     SEE ALSO

     DIAGNOSTICS

     If  "seg"  is  an invalid index in the LDT or the  virtual  space
     overflows an error is returned.


     ASSEMBLER

     core = 90

     entry:
     ax = "len"-1
     bx = "seg" (index of segment to be changed)

     int core

     exit:
     carry = 1 if error
     ax = error number if error
     all registers saved










				  - 281 -





     ENDPCS(2)						    ENDPCS(2)


     NAME

     endpcs -- terminate process


     SYNOPSIS

     endpcs(status)


     DESCRIPTION

     "endpcs"  terminates  the calling process.   All open  files  are
     closed   and   the  storage  associated  with  the   process   is
     deallocated.  If accounting has been enabled, the process owner's
     statistics   are  updated.    Any  process  that  is  waiting  on
     termination  of  the calling process is passed  "status"  and  is
     released from waiting and set to "runnable" state.


     SEE ALSO

     endump(2), pause(2)


     ASSEMBLER

     endpcs = 98

     entry:
     ax = "status" (passed to any process waiting on termination)

     int endpcs

     exit:
     endpcs does not return



















				  - 282 -





     ENDUMP(2)						    ENDUMP(2)


     NAME

     endump -- dump process and terminate


     SYNOPSIS

     endump(status,dumpfile)


     DESCRIPTION

     "endump"  creates a file named "dumpfile" and writes the  process
     object including all data segments in the LDT of the process into
     the  file.   It then terminates the process by closing all  files
     and  releasing  all associated storage (see endpcs(2)).   If  any
     process is waiting on termination of the calling process,  it  is
     passed "status" and is released.


     SEE ALSO

     endpcs(2), pause(2), procobj(5)


     ASSEMBLER

     endump = 99

     entry:
     ax = "status" (passed to any process waiting for termination)
     es = segment selector for "dumpfile" string
     bx = segment offset for "dumpfile" string

     int endump

     exit:
     endump does not return

















				  - 283 -





     FCLOSE(2)						    FCLOSE(2)


     NAME

     fclose -- close a file


     SYNOPSIS

     fclose(fildes)


     DESCRIPTION

     "fclose"  writes out all modified buffers of the file  associated
     with  "fildes" and deletes the file descriptor indexed by  fildes
     from  the process open file table.   ("fildes" is the index  into
     the  open  file  table  and is  returned  by  calls  to  "fopen",
     "fcreate" or "mkpip".)   If the file associated with "fildes"  is
     "/dev/ncube",  then the indicated subcube is deallocated and  all
     associated messages are destroyed.

     All files are closed automatically when a program terminates, but
     since  a  process can have only a fixed number of open  files  at
     once, "fclose" may be necessary for programs that manipulate many
     files.


     SEE ALSO

     fcreate(2), fopen(2), mkpip(2)


     DIAGNOSTICS

     An error is returned if "fildes" is not a valid index in the open
     file table.


     ASSEMBLER

     fclose = 94

     entry:
     ax = "fildes" (index into the open file table)

     int fclose

     exit:
     carry = 1 if error
     ax = error number if error
     all other registers saved





				  - 284 -





     FCREATE(2)						    FCREATE(2)


     NAME

     fcreate -- create a new file


     SYNOPSIS

     fcreate(type,flag,name)


     DESCRIPTION

     If  file "name" does not exist,  it is created;  if it does exist
     and is not open,  the new file replaces the old.   In either case
     the  file  is  opened  for writing and  the  index  of  the  file
     descriptor  in  the  open file table is returned.   If  the  file
     exists  and  is  already open,  it is not replaced  until  it  is
     closed.   The type of the created file is "type" (see FILE(5) for
     type definitions).

     The  above is true if "flag"><0.   However,  if "flag"=0 then  an
     error is returned if the file already exists.

     SEE ALSO

     fopen(2), fread(2), fwrite(2), fclose(2), file(5)


     DIAGNOSTICS

     An  error  is  returned if the process does not  have  sufficient
     rights,  if  there are too many open files or if "flag"=0 and  an
     attempt is made to "create" an already existing file.


     ASSEMBLER

     fcreate = 95

     entry:
     ax = "type" (file type for new file; al=type, ah=subtype)
     cx = "flag" (if "flag"=0 then existing files are preserved)
     es = segment selector for "name" string
     bx = segment offset for "name" string

     int fcreate

     exit:
     carry = 1 if error
     ax = "fildes" if no error or error number if error
     all other registers saved




				  - 285 -





     FDEL(2)						    FDEL(2)


     NAME

     fdel -- delete a file, link, directory or ddir


     SYNOPSIS

     fdel(flag,name)


     DESCRIPTION

     "fdel" deletes the file,  link,  directory or ddir whose name  is
     "name"  if  the process has sufficient rights.   If "name"  is  a
     link  and  "flag"=0,  then the entity pointed to by the  link  is
     deleted.  If "name" is a link and "flag"><0, then the link itself
     is  deleted.   (If "name" is not a link then the value of  "flag"
     does not matter.)


     SEE ALSO

     fcreate(2)


     DIAGNOSTICS

     An  error is returned if the process lacks sufficient rights  for
     deleting "name".


     ASSEMBLER

     fdel = 117

     entry:
     ax = "flag"
     es = segment selector for "name" string
     bs = segment offset for "name" string

     int fdel

     exit
     carry = 1 if error
     ax = error number if error
     all other registers saved









				  - 286 -





     FINFO(2)						    FINFO(2)


     NAME

     finfo -- return information about an open file


     SYNOPSIS

     finfo(fildes,data)


     DESCRIPTION

     "finfo" returns  information  about  the  open  file  indexed  by
     "fildes"  into the 64-byte array, "data".  The first 32 bytes are
     from the file descriptor and the second 32  bytes  are  from  the
     file header.


     SEE ALSO

     file(5), opntab(5)


     DIAGNOSTICS

     An error is returned if "fildes" is not valid.


     ASSEMBLER

     finfo = 18

     entry:

     ax = "fildes" (open file channel number)
     es = segment selector for "data"
     bx = segment offset to "data"

     int finfo

     exit:

     ax = error number if error
     carry = 1 if error
     all other registers saved










				  - 287 -





     FLKUP(2)						    FLKUP(2)


     NAME

     flkup -- look up a name and return directory or file data


     SYNOPSIS

     flkup(location,length,flag,name)


     DESCRIPTION

     "flkup"  finds  the  file or directory whose name is  "name"  and
     returns,  in  the same segment at the segment offset  "location",
     data describing the file or directory.  The maximum length of the
     returned data is "length".

     If "name" is a link and flag=0,  then the returned data describes
     the  entity  that the link points to.   If "name" is a  link  and
     "flag"><0, then the returned data describes the link itself.  (If
     "name" is not a link then the value of "flag" does not matter.)


     SEE ALSO

     fcreate, fopen, fseek, dir(5), file(5)


     DIAGNOSTICS

     An  error  is returned if "name" is not found or if  the  process
     lacks sufficient rights to "look up" the file.


     ASSEMBLER

     flkup = 88

     entry:
     ax = "location" (segment offset for data)
     cx = "length"-1
     dx = "flag"
     es = segment selector for "name" string
     bx = segment offset for "name" string

     int flkup

     exit:
     carry = 1 if error or "name" not found
     ax	 = error number if error or rights to level (AND of all rights
	   bits in pathname) if no error
     all other registers saved



				  - 288 -





     FMOUNT(2)						    FMOUNT(2)


     NAME

     fmount -- mount a file structured device


     SYNOPSIS

     fmount(dev,name)


     DESCRIPTION

     "fmount"  inserts a file structure on device number  "dev"  whose
     name is "name" into the file system.


     SEE ALSO

     funmnt(2)


     DIAGNOSTICS

     An  error is returned is "dev" is an invalid device number or  if
     "name" does not exist.


     ASSEMBLER

     fmount = 109

     entry:
     ax = "dev" (device number)
     es = segment selector for "name" string
     bx = segment offset for "name" string

     int fmount

     exit:
     carry = 1 if error
     ax = error number if error
     all other registers saved













				  - 289 -





     FMV(2)						     FMV(2)


     NAME

     fmv -- move file or tree


     SYNOPSIS

     fmv(srcpath,destpath)


     DESCRIPTION

     "fmv" moves a file or tree from "srcpath" to "destpath".


     SEE ALSO

     mv(1)


     DIAGNOSTICS

     If "srcpath" does not exist, an error is returned.


     ASSEMBLER

     fmv = 19

     entry:

     es = segment selector for "srcpath" string
     bx = segment offset to "srcpath" string
     ds = segment selector for "destpath" string
     ax = segment offset to "destpath" string

     int fmv

     exit:

     ax = error number if error
     carry = 1 if error
     all other registers saved












				  - 290 -





     FOPEN(2)						     FOPEN(2)


     NAME

     fopen -- open a file


     SYNOPSIS

     fopen(mode,name,dim)


     DESCRIPTION

     The file "name" is opened with its mode set to "mode".  The index
     ("fildes")  of  the  file descriptor in the open  file  table  is
     returned  and must be used in all future references to the  file.
     The  filepointer  in the file descriptor is initialized to  zero.
     The modes are

	       mode =  0:  open for execution
	       mode =  1:  open for write
	       mode =  2:  open for read
	       mode =  3:  open for both read and write
	       mode =  5:  lock for write
	       mode =  6:  lock for read
	       mode =  7:  lock for both read and write

     If "name" is "/dev/ncube" and mode = 3, then the system  attempts
     to allocate a subcube of dimension "dim".  If successful the type
     returned is "device" and the length is zero.

     SEE ALSO

     fcreate(2), fread(2), fwrite(2), fclose(2), file(5)


     DIAGNOSTICS

     An error is returned if the file does not exist,  if a  necessary
     directory does not exist, if the process does not have sufficient
     rights  to  the  file or if there is no space in  the  open  file
     table.   An error is also returned if  "fopen"  is being used  to
     allocate  a subcube and no subcube of the requested dimension  is
     available.












				  - 291 -





     FOPEN(2)						     FOPEN(2)



     ASSEMBLER

     fopen = 111

     entry:
     ax = "mode"
     es = segment selector for "name" string
     bx = segment offset for "name" string
     cx = "dim" (requested subcube dimension (3 to 10))

     int fopen

     exit:
     carry = 1 if error
     ax = "fildes" if no error or error number if error
     bx = file type
     dx:cx = file length
     all other registers are saved




































				  - 292 -





     FREAD(2)						     FREAD(2)


     NAME

     fread -- read from file or receive a message


     SYNOPSIS

     fread(fildes,nbytes,buffer,source,type)


     DESCRIPTION
     As  many  bytes  as possible (up to "nbytes") are read  into  the
     "buffer"  from the file whose file descriptor is indexed  in  the
     open file table by "fildes".  The data are read starting from the
     byte  addressed by the filepointer in the file descriptor and the
     number of bytes read is returned.  If the number of bytes read is
     less  than "nbytes",  it is because read is near the end  of  the
     file  or the file is a device that only reads a limited number of
     bytes at once.  If no data is left and an attempt is made to read
     the  end  of file,  an error is returned and "buffer" is  set  to
     ascii EOF (decimal 26).

     If "fildes" indicates a subcube ("/dev/ncube"),  then "fread"  is
     a  receive message function.   It will accept the next  available
     message  whose source and type are compatible with  the  "source"
     and "type" parameters into the array "buffer".   If  "source"  is
     "-1" then a message from any source will be accepted.   Otherwise
     only messages from the specified source will be read.   Similarly
     with the type parameter:  if "type" is "-1" then any type message
     will  be  accepted.   Otherwise the message type must  match  the
     parameter  "type" to be accepted.   The actual source and type of
     the message are stored at "source" and "type"  respectively.   If
     the  message  is  longer  than  "nbytes",  only  the  first  part
     is received.   "fread" is a blocking function and does not return
     until the message is received or an error is returned.


     SEE ALSO

     fopen(2), fcreate(2), mkpip(2)


     DIAGNOSTICS

     Among  the  error conditions are:   physical I/O  errors,  a  bad
     buffer address, invalid "fildes" and an incompatible message.









				  - 293 -





     FREAD(2)						     FREAD(2)



     ASSEMBLER

     fread = 114

     entry:
     ax = "fildes" (index into the open file table)
     cx = "nbytes"-1
     es = segment selector for buffer
     bx = segment offset for buffer
     dx = "source" reqested (-1 is do not care)
     di = "type" requested (-1 is do not care)

     int fread

     exit:
     carry = 1 if error
     ax = (number of bytes read)-1 if no error or
	  error number if error
     dx = actual source of message
     di = actual type of message
     all other registers saved

































				  - 294 -





     FRUN(2)						    FRUN(2)


     NAME

     frun -- run an executable file


     SYNOPSIS

     frun(state,priority,input,output,error,string)


     DESCRIPTION
     "frun"  creates a new process whose initial state is "state"  and
     runs the program in the file whose name is in "string".  A  stack
     segment  is  allocated  whose size is the length of "string" plus
     256 or the size specified in the EXE file, whichever  is  larger.
     "string"  is  stored  in the stack segment at location zero  (the
     stack pointer starts at the high  address  and  grows  downward).
     The  name of  the  file containing the program is taken to be the
     first substring that is terminated by a tab, space or null.   The
     rest  of  the  string  (up to the next null) is interpreted as an
     option list.   The process number  is  returned.   The   priority
     of  a  process   is  a  number between  0  and 255 inclusive with
     255  as  the   highest.    If   the   parameter   "priority"   is
     non-negative,   then the process  priority is  set  to the lesser
     of "priority" and the current priority  of the  calling  process.
     If "priority" is negative,  its value  is added  to  the  current
     priority of  the  calling  process,  thus reducing  the  priority
     of  the  new  process.   (It is never set less than  zero.)   The
     standard input,  output and  error   files   are  determined   by
     "input",  "output"	 and "error" values  as	 given below.

		  ←←←	←←←
	  "input"   |	|   < -1 :  no file
	  "output"  |---|   = -1 :  null device
	  "error" ←←|	|←← > -1 :  fildes (the file is indexed in the
				     calling program's open file table
				     by the value of the parameter)

     Normally,  the standard input, output and error files are indexed
     by "fildes" (file descriptor) of 0, 1 and 2 respectively.


     SEE ALSO

     endpcs(2), pause(2), procobj(5)


     DIAGNOSTICS

     An  error is returned if there is no room in the process table or
     if the file "name" is not an executable file.




				  - 295 -





     FRUN(2)						    FRUN(2)



     ASSEMBLER

     frun = 97

     entry:
     ax = "state" (initial state for new process)
     si = "priority" (priority of new process)
     cx = "input" (initial input file)
     dx = "output" (initial output file)
     di = "error" (initial error file)
     es = segment selector for "name" string
     bx = segment offset for "name" string

     int frun

     exit:
     carry = 1 if error
     ax = process number if no error or error number if error
     all other registers saved



































				  - 296 -





     FSHARE(2)						     FSHARE(2)


     NAME

     fshare -- share an allocated subcube from another process


     SYNOPSIS

     fshare(proc,fildes)


     DESCRIPTION
     "fshare" allows the calling process to share an allocated subcube
     with the indicated process, "proc".  The parameter,  "fildes"  is
     the  index  in  the  open  file  table of "proc" for an allocated
     subcube.  "fshare" returns the index in the  caller's  open  file
     table of the file descriptor for the shared subcube.


     SEE ALSO

     fopen(2)


     DIAGNOSTICS

     An error is returned if "fildes" or "proc" is invalid.


     ASSEMBLER

     fshare = 125

     entry:

     ax = "proc"
     bx = "fildes"


     int fshare

     exit:

     ax = error number if error otherwise open table index for share
     carry = 1 if error
     all other registers saved










				  - 297 -





     FSEEK(2)						     FSEEK(2)


     NAME

     fseek -- move read/write pointer (filepointer)


     SYNOPSIS

     fseek(fildes,offset)


     DESCRIPTION

     "fildes"  is  an index into the open file table and refers  to  a
     file  descriptor of an open file.   "fseek" sets the filepointer,
     the  component of the file descriptor that addresses  a  specific
     byte in the file, to the value of "offset" (a 32  bit  quantity).

     The  first  byte  or  beginning of file  is  reached  by  setting
     "offset" to zero.  If "offset" is larger than the number of bytes
     in the file,  then the filepointer is set to point at the end  of
     file and an error is returned.


     SEE ALSO

     fopen(2), fcreate(2)


     DIAGNOSTICS

     Errors  are returned for an undefined "fildes",  a seek on a pipe
     or a seek beyond the end of the file.


     ASSEMBLER

     fseek = 108

     entry:
     ax = "fildes" (index into open file table)
     bx = "offset" (low order part)
     cx = "offset" (high order part)

     int fseek

     exit:
     carry = 1 if error
     ax = error number if error
     all other registers saved






				  - 298 -





     FUNMNT(2)						    FUNMNT(2)


     NAME

     funmnt -- remove a file structured device


     SYNOPSIS

     funmnt(name)


     DESCRIPTION

     The file structure whose name is "name" is removed from the  file
     system.


     SEE ALSO

     fmount(2)


     DIAGNOSTICS

     An  error  is  returned  if  "name" does  not  exist  or  is  not
     removable.


     ASSEMBLER

     funmnt = 110

     entry:
     es = segment selector for "name" string
     bx = segment offset for "name" string

     int funmnt

     exit:
     carry = 1 if error
     ax = error number if error
     all other registers saved














				  - 299 -





     FWRITE(2)						     FWRITE(2)


     NAME

     fwrite -- write in a file or send a message


     SYNOPSIS

     fwrite(fildes,nbytes,buffer,dest,type)


     DESCRIPTION

     "fwrite" causes "nbytes" of data from "buffer" to be written into
     the  file whose file descriptor in the open file table is indexed
     by  "fildes".   The  write  starts in the file  at  the  location
     addressed by the filepointer in the file descriptor.

     If "fildes" indicates a subcube ("/dev/ncube"),  then "fwrite" is
     a  send  message  function.   It  takes  the data  in  the  array
     "buffer"  and  sends  it   (along  with    its   source,   length
     ("nbytes")  and "type")  to the destination indicated  by "dest".
     "fwrite"  blocks until the  message  has  been  copied  into  the
     VORTEX  system  memory, so when it returns the message buffer can
     be reused.

     SEE ALSO

     fcreate(2), fopen(2), mkpip(2)


     DIAGNOSTICS

     An error is returned when there is an invalid descriptor or  when
     there is a physical I/O error.





















				  - 300 -





     FWRITE(2)						     FWRITE(2)




     ASSEMBLER

     fwrite = 118

     entry:
     ax = "fildes" (index into the open file table)
     cx = "nbytes"-1
     es = segment selector for buffer
     bx = segment offset for buffer
     dx = "dest" (message destination)
     di = "type" of message

     int fwrite

     exit:
     carry = 1 (if error)
     ax = error number if error
     all other registers saved



































				  - 301 -





     GETDSK(2)						    GETDSK(2)


     NAME

     getdsk -- get disk status


     SYNOPSIS

     getdsk(disk,length,system,buffer)


     DESCRIPTION
     "getdsk"  writes in "buffer" the disk status information  (up  to
     "length" bytes) for disk number "disk" in system number "system".
     The format of the returned information is given in DSKDATA(5).


     SEE ALSO

     getpcs(2), getsys(2), dskdata(5)


     DIAGNOSTICS

     An error is returned for invalid values for "disk" or "system".


     ASSEMBLER

     getdsk = 102

     entry:
     ax = "disk" (disk number)
     cx = "length"-1
     dx = "system" (system:board number for disk)
     es = segment selector for status buffer
     bx = segment offset for status buffer

     int getdsk

     exit:
     carry = 1 if error
     ax = error number if error
     all other registers saved












				  - 302 -





     GETID(2)						    GETID(2)


     NAME

     getid -- get process and system ID


     SYNOPSIS

     getid(process,system)


     DESCRIPTION

     "getid" returns the process and system ID of the calling process.
     The system ID is a 24 bit number in cx:bx (the high order 8  bits
     are  in  cl) where the high order 21 bits designate a system  (or
     backplane) number and the low order 3 bits indicate a Host  Board
     slot number in that system.


     SEE ALSO

     getpcs(2)


     ASSEMBLER

     getid = 96

     entry:
     no parameters

     int getid

     exit:
     ax = "process" (process ID)
     cx:bx = "system" (system ID)
     all other registers saved


















				  - 303 -





     GETLST(2)						    GETLST(2)


     NAME

     getlst -- get list of known systems


     SYNOPSIS

     getlst(length,buffer)


     DESCRIPTION

     "getlst" writes a list (up to "length" bytes) in the "buffer"  of
     all  system  IDs  that  are connected to (known  by)  the  system
     running the calling process.


     SEE ALSO


     ASSEMBLER

     getlst = 106

     entry:
     ax = "length"-1 (maximum data length)
     es = segment selector for buffer
     bx = segment offset for buffer

     int getlst

     exit:
     carry = 1 if error
     ax = error number if error
     all other registers saved




















				  - 304 -





     GETPCS(2)						    GETPCS(2)


     NAME

     getpcs -- get process status


     SYNOPSIS

     getpcs(process,length,system,buffer)


     DESCRIPTION

     "getpcs" writes in "buffer" the status (up to "length" bytes) for
     the process whose ID is "process" in system "system".  The format
     of process status information is given in PROCOBJ(5).


     SEE ALSO

     getdsk(2), getsys(2), procobj(5)


     DIAGNOSTICS

     An error is returned if "process" is an invalid process ID or  if
     "system" is invalid.


     ASSEMBLER

     getpcs = 100

     entry:
     ax = "process" (process ID number)
     cx = "length"-1
     dx = "system" (system:board number for process)
     es = segment selector for buffer
     bx = segment offset for buffer

     int getpcs

     exit:
     carry = 1 if error
     ax = error number if error
     all other registers saved










				  - 305 -





     GETSYS(2)						    GETSYS(2)


     NAME

     getsys -- get system status


     SYNOPSIS

     getsys(system,length,buffer)


     DESCRIPTION

     "getsys"  writes  the  status (up to "length" bytes)  for  system
     number  "system" in "buffer".   The format for system  status  is
     given in SYSDATA(5).


     SEE ALSO

     getdsk(2), getpcs(2), sysdata(5)


     DIAGNOSTICS

     An error is returned if "system" is an invalid system number.


     ASSEMBLER

     getsys = 101

     entry:
     ax = "system" (system:board number for status)
     cx = "length"-1
     es = segment selector for buffer
     bx = segment offset for buffer

     int getsys

     exit:
     carry = 1 if error
     ax = error number if error
     all other registers saved












				  - 306 -





     MKDDIR(2)						    MKDDIR(2)


     NAME

     mkddir -- make a pointer to a device directory


     SYNOPSIS

     mkddir(dev,name)


     DESCRIPTION

     "mkddir" creates a pointer named "name" to the root directory for
     the device whose number is "dev".


     SEE ALSO

     mklnk(2), sysdev(5)


     DIAGNOSTICS

     An  error is returned if "dev" is an invalid device number or  if
     the process lacks sufficient rights for "mkddir".


     ASSEMBLER

     mkddir = 107

     entry:
     ax = "dev" (device number or remote ID: board#/disk#)
     es = segment selector for "name" string
     bx = segment offset for "name" string

     int mkddir

     exit:
     carry = 1 if error
     ax = error number if error
     all other registers saved













				  - 307 -





     MKLNK(2)						    MKLNK(2)


     NAME

     mklnk -- create a link


     SYNOPSIS

     mklnk(link,name)


     DESCRIPTION

     "mklnk"  creates a link whose text is "link" and stores it in the
     file "name".


     SEE ALSO

     mkddir(2)


     DIAGNOSTICS

     If the file "name" already exists, an error is returned.


     ASSEMBLER

     mklnk = 105

     entry:
     ds = segment selector for "link" text string
     ax = segment offset to "link" text string
     es = segment selector for "name" pathname string
     bx = segment offset to "name" pathname string

     int mklnk

     exit:
     carry = 1 if error
     ax = error number if error














				  - 308 -





     MKPIP(2)						    MKPIP(2)


     NAME

     mkpip -- create a pipe


     SYNOPSIS

     mkpip(write,read)


     DESCRIPTION

     "mkpip" creates a pipe.


     SEE ALSO

     mkddir(2), mklnk(2), pipobj(5)


     DIAGNOSTICS

     An error is returned if the process lacks rights to create pipes.


     ASSEMBLER

     mkpip = 113

     entry:
     no parameters

     int mkpip

     exit:
     carry = 1 if error
     ax = "fildes" for "write" if no error or error number if error
     bx = "fildes" for "read"

















				  - 309 -





     MULTIWAIT(2)					MULTIWAIT(2)


     NAME

     multiwait -- wait on multiple sources for input


     SYNOPSIS

     multiwait(table)


     DESCRIPTION

     "multiwait" waits on the set of channels that are in "table".


     SEE ALSO


     DIAGNOSTICS


     ASSEMBLER

     multiwait = 127

     entry:

     es = segment selector for "table"
     bx = segment offset of "table"

     int multiwait

     exit:

     ax = error number if error
     carry = 1 if error
     all other registers saved


















				  - 310 -





     PAUSE(2)						    PAUSE(2)


     NAME

     pause -- suspend process until event


     SYNOPSIS

     pause(status,process)


     DESCRIPTION

     "pause"  causes  the calling process to wait for   the  specified
     condition.  On return, if the process was waiting on termination,
     the  status  of the terminating process will be found in  the  ax
     register.  Status numbers from 0 to 63 inclusive are reserved for
     the system (see PROCOBJ(5)) and normally you should not pause  on
     one of the system status numbers since "wake" cannot wake you up.
     One  useful exception is to pause on 24 which is "wait on process
     termination".  When the indicated process terminates, you will be
     awakened  with  the status of the terminating process in  the  ax
     register.   The  numbers  greater  than 63 are  for  general  use
     although "adb(1)" uses 64 for trace, 65 for breakpoint and 66 for
     debug stop and the spooler uses 67.


     SEE ALSO

     adb(1), wake(2), procobj(5)


     ASSEMBLER

     pause = 112

     entry:
     ax = "status" (status to wait on)
     bx = "process" (ID of process to wait on)

     int pause

     exit:
     ax = status from terminating process if waiting for termination
     all registers saved











				  - 311 -





     PSEND(2)						    PSEND(2)


     NAME

     psend -- send a signal and message to a process


     SYNOPSIS

     psend(process,length,signal,system,message)


     DESCRIPTION

     "psend" sends signal number "signal" and message string "message"
     (of "length" bytes) to process number "process" in system  number
     "system".   ("message"  is  only used with signal 15 and  is  for
     implementing "write".)  To "psend" to a process,  the caller must
     either be a superuser or it must own the receiving process.   See
     VECTOR(2) for the signal numbers and definitions.


     SEE ALSO

     write(1), vector(2), procobj(5)


     DIAGNOSTICS

     An  error is returned if "signal" is an invalid signal number  or
     if the process lacks sufficient rights to send the signal.


     ASSEMBLER

     psend = 104

     entry:
     ax = "process" (process ID for send)
     cx = "length"-1
     dx = "signal" (signal number)
     si = "system" (system ID for process)
     es = segment selector for "message" string
     bx = segment offset for "message" string

     int psend

     exit:
     carry = 1 if error
     ax = error number if error
     all other registers saved






				  - 312 -





     SHARE(2)						    SHARE(2)


     NAME

     share -- share segment with another process


     SYNOPSIS

     share(process,index,segment)


     DESCRIPTION

     A process running on the 80286 addresses memory using two 16  bit
     pointers, "offset" and "index".  "Index" is the offset in the LDT
     (Local Descriptor Table)  of the process and thus locates one  of
     the segments in its address space.  "Offset" locates a particular
     byte in the segment.

     "share"  enables processes to access each others memory space  by
     copying LDT entries from one process to another.   The LDT  entry
     located by  "index" in process number "process" is copied to  the
     LDT  entry  indexed  by  "segment"  in the calling  process.   If
     "segment" points to a valid descriptor, its memory is deallocated
     and reclaimed by the operating system.   Thus,  memory references
     to bytes in "segment" in the calling process will access data  in
     the segment "index" in process number "process".

     "share"  is particularly useful when different Fortran  processes
     have been compiled with their common blocks in separate segments.
     Then  "sharing"  them  makes  the blocks  "common"  even  between
     separate processes.


     SEE ALSO

     core(2), procobj(5)


     DIAGNOSTICS

     An error is returned if "process" is not a valid ID,  if  "index"
     does not refer to a valid segment or if "segment" is not a  valid
     index.  Also, the caller must own "process" or be a Superuser.












				  - 313 -





     SHARE(2)						    SHARE(2)



     ASSEMBLER

     share = 93

     entry:
     ax = "process" (ID of process to share segment with)
     bx = "index" (LDT index of "process")
     cx = "segment" (LDT entry for segment of calling process)

     int share

     exit:
     carry = 1 if error
     ax = error number if error
     all other registers saved







































				  - 314 -





     SLEEP(2)						    SLEEP(2)


     NAME

     sleep -- suspend calling process for n seconds


     SYNOPSIS

     sleep(seconds)


     DESCRIPTION

     "sleep" causes the calling process to be suspended for  "seconds"
     seconds.

     SEE ALSO

     pause(2), wake(2)


     ASSEMBLER

     sleep = 123

     entry:
     ax = "seconds" (number of seconds to sleep)

     int sleep

     exit:
     all registers saved
























				  - 315 -





     SPECIAL(2)						    SPECIAL(2)


     NAME

     special -- special file or message operations


     SYNOPSIS

     special(fildes,opnum,parameter1,parameter2)


     DESCRIPTION

     The  special  operation  system  call  (interrupt  103)  allows a
     program  to  obtain  status  information   or   perform   control
     operations  on  a  currently  open  file channel. The form of the
     special call is as follows:

	  At Entry:
	       AX = File channel number
	       CX = Special operation number (0-N)
	       BX,DX = Special operation parameters

	  At Exit:
	       AX = Error number if error else returned status
	       BX,DX = Returned values
	       Carry = True if error
	       All other registers saved

     In general, the  functions  provided  by  the  special  call  are
     dependent  on  the type of object (file, pipe, or device) that is
     referred to by the open channel. The object type and state  (open
     or  closed)  of a particular channel can be determined by looking
     in the open table in the process' process object. The first  four
     special call types perform similar functions for all object types
     and have the following definitions:

	  0 - Object independent status
	  1 - Object dependent status
	  2 - Object dependent control operation
	  3 - Wakeup on input ready (used by eventwait)

     Special call type 0 is defined identically for  all  objects  and
     returns  the  status  of  input  and  output for the channel. The
     status is returned in AX with Bit15=1 if the channel is ready for
     output  and  Bit0=1  if  the channel currently has input waiting.
     All other bits are set to zero.

     Special call type 3 is also defined identically for  all  objects
     and  is  used  by the eventwait system call to allow a process to
     wait on input from two or more sources. A process should not  use
     the type 3 special operation directly.




				  - 316 -





     SPECIAL(2)						    SPECIAL(2)



     File Object Special Calls

       Types 0 and 1 - Input/Output Status

	    At Entry:
		 AX = File channel number
		 CX = 0 or 1
	    At Exit:
		 AX = Error number if error else returned status
		   Bit 0  = 1 if have file read rights and
			      file pointer not at end of file
		   Bit 15 = 1 if have file write rights
		 Carry = True if error
		 All other registers saved


       Type 3 - Wakeup on input ready

	    At Entry:
		 AX = File channel number
		 CX = 3

	    At Exit:
		 AX = Error number if error
		 Carry = True if error
		 All other registers saved

	  This call always immediately wakes up the waiting process
	  since it is not meaningful to wait for new input from a
	  file.

       Special call type 2 and types 4 or greater are not defined for
       files and will cause a invalid special call error to be
       returned.




















				  - 317 -





     SPECIAL(2)						   SPECIAL(2)


     Pipe Object Special Calls

       Type 0  - Input/Output Status

	    At Entry:
		 AX = File channel number
		 CX = 0

	    At Exit:
		 AX = Error number if error else returned status
		   Bit 0  = 1 if have pipe read rights
			      and pipe not empty
		   Bit 15 = 1 if have pipe write rights
			      and pipe not full
		 Carry = True if error
		 All other registers saved
       Type 1  - Pipe Status

	    At Entry:
		 AX = File channel number
		 CX = 1

	    At Exit:
		 AX = Error number if error else returned status
		   Bit 0  = 1 if have pipe read rights
			      and pipe not empty
		   Bit 15 = 1 if have pipe write rights
			      and pipe not full
		 Carry = True if error
		 BX = Number of pipe read connections
		 DX = Number of pipe write connections
		 All other registers saved
       Type 3 - Wakeup on input ready

	    At Entry:
		 AX = File channel number
		 CX = 3

	    At Exit:
		 AX = Error number if error
		 Carry = True if error
		 All other registers saved

	 This call immediately wakes up the waiting process if the
	 pipe is not empty or if the process doesn't have read
	 rights for the pipe. Otherwise the process is awakened the
	 next time the pipe becomes not empty. The process is also
	 awakened if all write connections to the pipe are closed.

       Special call type 2 and types 4 or greater are not defined for
       pipes and will cause a invalid special call error to be
       returned.



				  - 318 -





     SPECIAL(2)						    SPECIAL(2)



     /DEV/SCC0-7 Object Special Calls

       Type 0  - Input/Output Status

	    At Entry:
		 AX = File channel number
		 CX = 0

	    At Exit:
		 AX = Error number if error else returned status
		   Bit 0  = 1 if have read rights and the
			      input buffer is not empty
		   Bit 15 = 1 if have write rights and the
			      output buffer is not full
		 Carry = True if error
		 All other registers saved






































				  - 319 -





     SPECIAL(2)						SPECIAL(2)


       Type 1  - Serial Channel Status

	    At Entry:
		 AX = File channel number
		 ES:BX = Pointer to 32-byte data area
			 for status information
		 CX = 1

	    At Exit:
		 AX = Error number if error
		 Carry = True if error
		 All other registers saved
	 The 32-byte serial channel status information has
	 the following format:

	 byte  definition
	  0    Input XON/XOFF protocol enable (data to NCUBE)
	  1    Output XON/XOFF protocol enable (data to terminal)
	  2    Abort character enable
	  3    Output cancel character enable
	  4    Modem signal control enable
	  5    Map LF to CRLF on output enable
	  6    Clear-To-Send output signal enable
	  7    Parity check on input characters enable
	  8    XOFF character (default ↑S)
	  9    XON character (default ↑Q)
	 10    Abort character (default ↑C)
	 11    Output cancel character (default ↑O)
	 12    Bits per character (0=5, 1=6, 2=7, 3=8)
	 13    Stop bits (0=1, 1=2 stop bits)
	 14    Parity checking mode (0=even, 1=odd)
	 15    RTS state (0 or 1)
	 16-17 Baud rate (1 to 19200)
	 18    CTS input state (0 or 1)
	 19    DCD input state (0 or 1)
	 20-31 Reserved (set to zero)
	 The mode enable bytes are 0 for mode disabled and 1 for
	 mode enabled. The control characters are 7-bit ascii
	 character codes for the specified functions.
















				  - 320 -





     SPECIAL(2)						  SPECIAL(2)

       Type 2  - Set Serial Channel State

	    At Entry:
		 AX = File channel number
		 ES:BX = Pointer to 32-byte data area
		 CX = 2

	    At Exit:
		 AX = Error number if error
		 Carry = True if error
		 All other registers saved
	 The serial channels have several parameters which can be
	 set with this special call. All 32 bytes are always read
	 by the call but only those fields which have their sign
	 bit (MSB) set are modified. The value of the parameter is
	 set to the input value with the sign bit masked off. The
	 control fields are defined as follows:

	 byte  definition
	  0    Input XON/XOFF protocol enable (data to NCUBE)
	  1    Output XON/XOFF protocol enable (data to terminal)
	  2    Abort character enable
	  3    Output cancel character enable
	  4    Modem signal control enable
	  5    Map LF to CRLF on output enable
	  6    Clear-To-Send output signal enable
	  7    Parity check on input characters enable
	  8    XOFF character (default ↑S)
	  9    XON character (default ↑Q)
	 10    Abort character (default ↑C)
	 11    Output cancel character (default ↑O)
	 12    Bits per character (0=5, 1=6, 2=7, 3=8)
	 13    Stop bits (0=1, 1=2 stop bits)
	 14    Parity checking mode (0=even, 1=odd)
	 15    RTS state (0 or 1)
	 16-17 Baud rate (1 to 19200)
	 18    Reset serial channel state
	 19-31 Reserved (should be zero)


















				  - 321 -





     SPECIAL(2)						SPECIAL(2)


       Type 3 - Wakeup on input ready

	    At Entry:
		 AX = File channel number
		 CX = 3

	    At Exit:
		 AX = Error number if error
		 Carry = True if error
		 All other registers saved
	 This call immediately wakes up the waiting process if the
	 input buffer is not empty or if the process doesn't have
	 read rights for the channel. Otherwise the process is
	 awakened the next time a character is received by the serial
	 channel.

       Special call types 4 or greater are not defined for serial
       channels and will cause an error to be returned.





































				  - 322 -





     SPECIAL(2)						  SPECIAL(2)

     /DEV/TAPE Object Special Calls

       Type 0  - Input/Output Status

	    At Entry:
		 AX = File channel number
		 CX = 0

	    At Exit:
		 AX = Error number if error else returned status
		   Bit 0  = 1 always
		   Bit 15 = 1 always
		 Carry = True if error
		 All other registers saved


       Type 1  - Tape Controller Status

	    At Entry:
		 AX = File channel number
		 CX = 1

	    At Exit:
		 AX = Error number if error else
		      tape controller status word 2
		 Carry = True if error
		 All other registers saved


       Type 2  - Read Tape Controller Memory

	    At Entry:
		 AX = File channel number
		 BX = Tape controller read memory address
		 CX = 2

	    At Exit:
		 AX = Error number if error else
		      requested tape controller memory word
		 Carry = True if error
		 All other registers saved















				  - 323 -





     SPECIAL(2)					      SPECIAL(2)


       Type 3 - Wakeup on input ready

	    At Entry:
		 AX = File channel number
		 CX = 3

	    At Exit:
		 AX = Error number if error
		 Carry = True if error
		 All other registers saved
	 This call immediately wakes up the waiting process since
	 input wait is not defined for the tape drive.











































				  - 324 -





     SPECIAL(2)						   SPECIAL(2)


       Type 4 - Reset tape controller

	    At Entry:
		 AX = File channel number
		 CX = 4

	    At Exit:
		 AX = Error number if error
		 Carry = True if error
		 All other registers saved


       Type 5 - Unload tape

	    At Entry:
		 AX = File channel number
		 CX = 5

	    At Exit:
		 AX = Error number if error
		 Carry = True if error
		 All other registers saved


       Type 6 - Tape certify

	    At Entry:
		 AX = File channel number
		 BX = Certify start tape address/2
		 CX = 6
		 DX = Certify end tape address/2

	    At Exit:
		 AX = Error number if error
		 Carry = True if error
		 All other registers saved



















				  - 325 -





     SPECIAL(2)					     SPECIAL(2)


       Type 7 - Write tape controller memory

	    At Entry:
		 AX = File channel number
		 BX = Tape controller memory write address
		 CX = 7
		 DX = Value to be written to controller memory

	    At Exit:
		 AX = Error number if error
		 Carry = True if error
		 All other registers saved

       Special call types 8 or greater are not defined for the tape
       drive and will cause a invalid special call error to be
       returned.







































				  - 326 -





     SPECIAL(2)						   SPECIAL(2)


     /DEV/LPT Object Special Calls -


       Type 0  - Input/Output Status

	    At Entry:
		 AX = File channel number
		 CX = 0

	    At Exit:
		 AX = Error number if error else returned status
		   Bit 0  = 0 always
		   Bit 15 = 1 always
		 Carry = True if error
		 All other registers saved


       Type 1  - Printer Status

	    At Entry:
		 AX = File channel number
		 CX = 1

	    At Exit:
		 AX = Error number if error else returned status
		   Bit 0-7 = Last character written to printer
		   Bit 8   = 1 if printer selected
		   Bit 9   = 1 if printer paper error
		   Bit 10  = 1 if printer fault
		   Bit 11  = 1 if printer ready
		   Bit 12  = 1 if printer in diagnostic mode
		   Bit 13-15 = reserved
		 Carry = True if error
		 All other registers saved


       Type 3 - Wakeup on input ready

	    At Entry:
		 AX = File channel number
		 CX = 3

	    At Exit:
		 AX = Error number if error
		 Carry = True if error
		 All other registers saved
	 This call always immediately wakes up the waiting process.
	 It is not meaningful to wait on input from the printer.

       Special call type 2 and types 4 or greater are not defined
       for the printer and will cause a invalid special call error
       to be returned.



				  - 327 -





     SPECIAL(2)						  SPECIAL(2)


     /DEV/NULL Object Special Calls -

       Types 0 and 1 - Input/Output Status

	    At Entry:
		 AX = File channel number
		 CX = 0 or 1

	    At Exit:
		 AX = Error number if error else returned status
		   Bit 0  = 0 always
		   Bit 15 = 1 always
		 Carry = True if error
		 All other registers saved


       Type 3 - Wakeup on input ready

	    At Entry:
		 AX = File channel number
		 CX = 3

	    At Exit:
		 AX = Error number if error
		 Carry = True if error
		 All other registers saved

	 This call always immediately wakes up the waiting process
	 since it is not meaningful to wait for input from the null
	 device.

       Special call type 2 and types 4 or greater are not defined for
       the null device and will cause a invalid special call error to
       be returned.





















				  - 328 -





     SPECIAL(2)						  SPECIAL(2)

     /DEV/CRT Object Special Calls -

       Type 0  - Input/Output Status

	    At Entry:
		 AX = File channel number
		 CX = 0

	    At Exit:
		 AX = Error number if error else returned status
		   Bit 0  = 1 if have read rights and
			    ACRTC output fifo not empty
		   Bit 15 = 1 if have write rights and
			    ACRTC input fifo not full
		 Carry = True if error
		 All other registers saved


     Type 1  - Hitachi ACRTC Status

	  At Entry:
	       AX = File channel number
	       CX = 1

	  At Exit:
	       AX = Error number if error else
		    Hitachi ACRTC status byte
	       Carry = True if error
	       All other registers saved


       Type 2 - Set ACRTC register

	    At Entry:
		 AX = File channel number
		 BX = Register address
		 CX = 2
		 DX = Value to be written to register

	    At Exit:
		 AX = Error number if error
		 Carry = True if error
		 All other registers saved













				  - 329 -





     SPECIAL(2)					    SPECIAL(2)


       Type 3 - Wakeup on input ready

	    At Entry:
		 AX = File channel number
		 CX = 3

	    At Exit:
		 AX = Error number if error
		 Carry = True if error
		 All other registers saved
	 This call immediately wakes up the waiting process. Wait
	 is not supported for the graphics crt device.











































				  - 330 -





     SPECIAL(2)					     SPECIAL(2)

       Type 4 - Set color table entry

	    At Entry:
		 AX = File channel number
		 BL = Color table address
		 BH = Red color intensity
		 CX = 4
		 DL = Green color intensity
		 DH = Blue color intensity

	    At Exit:
		 AX = Error number if error
		 Carry = True if error
		 All other registers saved

       Type 5 - DMA read from ACRTC fifo to memory

	    At Entry:
		 AX = File channel number
		 ES:BX = Data address for DMA
		 CX = 5
		 DX = DMA data length in bytes -1

	    At Exit:
		 AX = Error number if error
		 Carry = True if error
		 All other registers saved
	 Note that an ACRTC DMARD command must be issued before
	 using this special call. Extreme care should be taken to
	 match the length of DMARD operation with the length of the
	 DMA otherwise the ACRTC may be become hung and only a
	 system reset can clear it.
























				  - 331 -





     SPECIAL(2)					      SPECIAL(2)


       Type 6 - DMA write from memory to ACRTC fifo

	    At Entry:
		 AX = File channel number
		 ES:BX = Data address for DMA
		 CX = 5
		 DX = DMA data length in bytes -1

	    At Exit:
		 AX = Error number if error
		 Carry = True if error
		 All other registers saved
	 Note that an ACRTC DMAWR command must be issued before
	 using this special call. Extreme care should be taken to
	 match the length of DMAWR operation with the length of the
	 DMA otherwise the ACRTC may become hung and only a
	 system reset can clear it.

       Special call types 7 or greater are not defined for the
       graphics device and will cause a invalid special call error
       to be returned.


































				  - 332 -





     SPECIAL(2)						  SPECIAL(2)


     /DEV/NCUBE Object Special Calls

       Type 0  - Input/Output Status

	    At Entry:
		 AX = File channel number
		 CX = 0

	    At Exit:
		 AX = Error number if error else returned status
		   Bit 0  = 1 if have read rights and
			    message waiting for process
		   Bit 15 = 1 always
		 Carry = True if error
		 All other registers saved


       Type 1  - Input Message Status

	    At Entry:
		 AX = File channel number
		 CX = 1
		 DX = Requested message source
		 DI = Requested message type

	    At Exit:
		 AX = Error number if no message found
		 DX = Message source if message found
		 DI = Message type if message found
		 Carry = True if error
		 All other registers saved


       Type 2  - Set/reset Host Nodes (only Superuser)

	    At Entry:
		 AX = File channel number
		 BX = Reset state (0 = reset, 1=unreset)
		 CX = 2

	    At Exit:
		 AX = Error number if error
		 Carry = True if error
		 All other registers saved











				  - 333 -





     SPECIAL(2)						 SPECIAL(2)


       Type 3 - Wakeup on input ready

	    At Entry:
		 AX = File channel number
		 CX = 3

	    At Exit:
		 AX = Error number if error
		 Carry = True if error
		 All other registers saved

	 This call immediately wakes up the waiting process if a
	 message is waiting for the process or if the process
	 does not have read rights for the pipe. Otherwise the
	 process is awakened the next time a message is received
	 for the process.


       Type 4  - Set/reset Processor Board Nodes (only Superuser)

	    At Entry:
		 AX = File channel number
		 BX = Reset state (0 = reset, 1=unreset)
		   Bit 0 = Processor board 0
		   Bit 1 = Processor board 1, etc.
		 CX = 4

	    At Exit:
		 AX = Error number if error
		 Carry = True if error
		 All other registers saved

       Special call types 5 or greater are not defined for the
       hypercube and will cause a invalid special call error to
       be returned.




















				  - 334 -





     SYSHUT(2)						    SYSHUT(2)


     NAME

     syshut -- clean up system and invoke RAM Monitor


     SYNOPSIS

     syshut


     DESCRIPTION
     "syshut"   closes all open files,  terminates all  processes  and
     generally cleans up the system.  Then it invokes the RAM Monitor.


     ASSEMBLER

     syshut = 120

     entry:
     no parameters

     int syshut

     exit:
     does not return





























				  - 335 -





     UNCORE(2)						    UNCORE(2)


     NAME

     uncore -- release segment in process LDT space


     SYNOPSIS

     uncore(index)


     DESCRIPTION

     "uncore" releases the segment in the caller's LDT that is indexed
     by "index".


     SEE ALSO

     core(2)


     DIAGNOSTICS


     ASSEMBLER

     uncore =

     entry:

     bx = "index"

     int uncore

     exit:

     ax = error number if error
     carry = 1 if error
     all other registers saved
















				  - 336 -





     VECTOR(2)						    VECTOR(2)


     NAME

     vector -- set process interrupt vector


     SYNOPSIS

     vector(signum,label)


     DESCRIPTION

     A signal can be generated by a user (abort, interrupt), a program
     error  (floating point exception,  integer overflow)  or  another
     process  (kill,  message).   The default response to all  signals
     causes the receiving process to terminate.   However,  a "vector"
     call allows a process to respond to a signal with an interrupt to
     a specific location ("label") for interrupt handling.

     If "label" is 0, the response is reset to the default (the signal
     "signum"  causes  termination);  otherwise the signal  causes  an
     interrupt  to  the  location  "label".    The  signals  that  are
     recognized and the corresponding vectors that can be set are

	  SIGKILL   0	 kill process (cannot be caught or handled)
	  SIGABRT   1	 abort (↑C)
	  SIGFP	    2	 floating point exception
	  SIGINTO   3	 integer overflow
	  SIGALRM   4	 alarm
	  SIGINT    5	 interrupt
	  SIGPROT   6	 process protection violation
	  SIGILL    7	 illegal instruction
	  SIGBKPT   8	 breakpoint
	  SIGTRC    9	 trace trap
	  SIGRES1  10	 reserved
	  SIGRES2  11	 reserved
	  SIGRES3  12	 reserved
	  SIGRES4  13	 reserved
	  SIGMSGS  14	 pause process (see below)
	  SIGMSGP  15	 allow/disallow messages (see below)















				  - 337 -





     VECTOR(2)						    VECTOR(2)



     As stated above, "vector(0,label)" has no effect.	For any signal
     number except 0, if label=0, the vector is turned off.

     Signal  numbers 10,11,12 and 13 are RESERVED.   Also,  numbers 14
     and  15 have special functions.   Calling "vector(15,#)" has  the
     effect  of allowing messages if #<>0 and disallowing messages  if
     #=0  (see WRITE(1)).   Signal 14 is used for process  suspension.
     If "psend" is called with signal number 14,  the named process is
     suspended.

     A	requirement of the system is that any interrupt	 handler  must
     save  and	restore its own registers and it must return  with  an
     "IRET" (return from interrupt) instruction.


     SEE ALSO

     write(1), psend(2), procobj(5)


     DIAGNOSTICS

     An error is returned if "signum" is out of range.


     ASSEMBLER

     vector = 115

     entry:
     ax = "signum" (number of interrupt vector to be set)
     cx = segment selector for vector destination ("label")
     bx = segment offset for vector destination ("label")

     int vector

     exit:
     carry = 1 if error
     ax = error number if error
     all other registers saved














				  - 338 -





     WAKE(2)						    WAKE(2)



     NAME

     wake -- wake up a process


     SYNOPSIS

     wake(process,status)


     DESCRIPTION

     "wake"  causes processes to be awakened.   If "status"  is  zero,
     then "process" is awakened regardless of status.   If "status" is
     nonzero and "process" is zero,  then all processes that have that
     status  are awakened.   If both parameters are nonzero,  then the
     process  whose ID is "process" is awakened only if its status  is
     "status".   The  value of "status" must be greater than 63  since
     the  status numbers from 0 to 63 are reserved for  the  operating
     system.


     SEE ALSO

     pause (2), sleep(2), procobj(5)


     DIAGNOSTICS

     An  error is returned if "process" is an invalid process ID or if
     "status" is less than 64.


     ASSEMBLER

     wake = 121

     entry:
     ax = "process" (ID of process to be awakened)
     bx = "status"

     int wake

     exit:
     carry = 1 if error
     ax = error number if error
     all other registers saved







				  - 339 -





     5.3.2.3  Subroutines

























































				  - 340 -





     5.3.2.4  Special Files

     The  system maintains several special files for system management
     and other uses.  They are listed below.


     /dev		  a directory of system device files including
			  /dev/ncube (the hypercube processor array)

     /bin		  a directory containing the system commands
			  as executable files

     /phy		  a directory with files for badsectors,
			  diskdata, freepool, and systemdata

     /sys		  a directory containing several directories
			  and files of system information

	/sys/acct	  a directory with an account file for each
			  user

	/sys/bin	  a directory that contains files with the
			  object of the operating system, the login
			  command, the spooler and the user account
			  editor ("edusr")

	/sys/games	  a directory of games including "life"

	/sys/help	  a directory of files that contain the help
			  messages for the commands

	/sys/spool.log	  a file with the names of all the files that
			  have been printed by the spooler;  the last
			  name is the file currently being printed

	/sys/startup	  the startup file that configures the system

	/sys/startup.log  the output file for /sys/startup

	/sys/sysmsg	  a directory of files whose names are the
			  error numbers and whose contents are the
			  error messages

	/sys/usrlist	  a file that contains the list of all the
			  current users;  the user number is an index
			  to the user name












				  - 341 -





     /usr		  a directory that usually has a root
			  directory for each user

	/usr/bin	  a directory of useful but unsupported
			  commands:
			    "af" removes parity bits and <cr>s; it is
			     useful after downloading with "cat";
			    "listsrc" creates from a list file a
			     source file that can be assembled;
			    "inf" is an executable file with an
			     infinite loop;
			    "ud" converts a text file to binary (see
			     "help ud", useful with "hd" for
			     editing binary files;

	/usr/ncube	  NCUBE's working directory

	/usr/ncube/sample a directory with program examples;
			   "cmd.src" is a simple parser with some
			    support routines that help in creating
			    custom commands (it is also a good
			    example of assembly language programming)
			   "asn.src" is an example NCUBE processor
			    assembly language program;

	/usr/ncube/handbook a file containing the NCUBE HANDBOOK

	/usr/spool/lpt	  a directory that contains all the files that
			  the spooler is waiting to print





























				  - 342 -





     5.3.2.5  File Formats and Conventions

     In this section we will specify the data structures that are used
     in  the  operating system.   Most of the structures are used  for
     managing


		    processes
			 procobj -- process object format

		    files
			 cactab -- sector buffer cache format
			 dir -- directory format
			 exe -- 80286 executable file format
			 exen -- Node executable file format
			 file -- file format
			 opntab -- open file table format

		    pipes
			 pipeobj -- pipe object format

		    devices
			 dskdata -- format of disk support data

		    system
			 sysdata -- system data file format
			 sysdev -- device index definition


     To  fully understand some of these structures it is necessary  to
     have a working knowledge of the 80286 (see iAPX 286  Programmer's
     Reference Manual from Intel for details).   Some of the important
     characteristics of the 80286 are:

	  1) Memory is treated as a set of variable length (up to 64
	     Kbytes) segments.
	  2) Each segment has a virtual address that consists of two
	     parts (each part is two bytes)
		  a) an index (segment selector) into one of two
		     tables of segment descriptors:  the Global
		     Descriptor Table (GDT) and the Local
		     Descriptor Table (LDT).
		  b) an offset into the selected segment
	  3) The hardware recognizes some special segments and has
	     support for fast task switching.  These include the GDT,
	     the LDT and the Task State Segment (TSS).

     In  the specifications below the abreviations have the  following
     meanings:   C = Constant,  B = Byte,  H = Halfword, W = Word, D =
     Double Word.   If a Word is an address in memory then it consists
     of  the two parts described above.   If a Word is a disk  address
     then it has three parts that designate cylinder, head and sector.
     A disk sector consists of 1024 bytes.





				  - 343 -





     CACTAB(5)						    CACTAB(5)


     NAME

     cactab -- format of the sector buffer cache table


     DESCRIPTION

     The   file   system maintains a cache of buffers for disk sectors
     to minimize the actual disk traffic.   The number of  buffers  is
     set  by  the system variable "caccnt".   When the buffers are all
     full and  a  sector must be read that is not in a   buffer,   the
     least  recently   used   buffer  is  used  for  the  new  sector.
     Therefore, the  buffers are arranged in  a  linked  list  with  a
     system  variable  "lruptr"  pointing  to  the least recently used
     buffer.  The entries in  the sector buffer cache table (which  is
     located  at   "cactab")  are  called  sector  buffer  descriptors
     ("secbufdes")  and	 are specified below.

	  secbufdes -- format of a sector buffer descriptor
	       H  caclruf ;least recently used link forward
	       H  caclrup ;least recently used link backward
	       B  cacst	  ;buffer status (see below)/access count
	       B  cacmod  ;buffer modified
	       H  cacchn  ;lock chain for buffer
	       H  cacchne ;
	       H  cacdev  ;device number ( *2 ) for buffer
	       W  cacadr  ;disk address/device number of buffer

	  cacst
	       C  unchanged = 0 ;buffer not saved on swap
	       C  modified  = 1 ;buffer modified (saved on swap)



     SEE ALSO

     sysdata(5)


















				  - 344 -





     DIR(5)						    DIR(5)


     NAME

     dir -- format of a directory


     DESCRIPTION

     Each  node  in  the  file system hierarchy  is  a  directory.   A
     directory contains pointers to files or other directories.  Names
     of files and directories can have at most 24 characters from  the
     set  (a-z,0-9,$,←,.).   A  directory  is  made  of  one  or  more
     directory sectors ("dirsec").   A directory sector contains up to
     32 entries,  each of which is 32 bytes.  The first entry contains
     defining  information  about  the directory.   The  rest  of  the
     entries,  called  directory pointers ("dirptr"),  are pointers to
     files or other directories.   The structure of directory  sectors
     and directory pointers are specified below.

	  dirsec -- format of a directory sector
	       H     dirid   ;non-ASCII magic number (F4F1) that is
			     ;checked on every reference to the dirsec
	       B     ptrcnt  ;number of active pointers
	       B     level   ;level of directory in hierarchy
	       W     nxtdir  ;disk address of next dirsec in this node
	       W     dirdate ;creation date of directory
	       H     dirown  ;directory owner number
	       B(18) res     ;reserved
	       W(8)  dirptr  ;first of variable number (up to 31) of
			     ;pointers to files or directories


	  dirptr -- format of a directory pointer
	       B(24) name    ;24 character name of file or directory
	       H     rights  ;rights associated with name (see below)
	       H     ddirdev ;device for ddir pointer (if not null
			     ;dirptr points to device root)
	       W     nodptr  ;disk address of next node or file


















				  - 345 -





     DIR(5)						    DIR(5)



	  rights -- rights (and type) associated with name
		    (0=granted, 1=denied)
		      ←←←
	       bit  0:	 | type of object named (00 = file/device,
	       bit  1:←←←| 01 = link, 10 = ddir, 11 = directory)
	       bit  2:	valid pointer
	       bit  3:	reserved
	       bit  4:	delete file
	       bit  5:	execute file
	       bit  6:	write file
	       bit  7:	read file
	       bit  8:	change names in directory
	       bit  9:	create and change links
	       bit 10:	traverse directory for file lookup
	       bit 11:	delete entry in directory
	       bit 12:	delete directory
	       bit 13:	alter access rights
	       bit 14:	create entry in directory
	       bit 15:	read contents of directory


     SEE ALSO

     file(5)






























				  - 346 -





     DSKDATA(5)						    DSKDATA(5)


     NAME

     dskdata -- format of the disk support data (/phy/diskdata)


     DESCRIPTION

     For  each  physical disk,  a memory segment is allocated  by  the
     system  to buffer two disk allocation sectors and to hold  status
     information about the disk drive.   The segment is accessed  with
     the "getdsk" system call and its format is given below.

	  dskdata -- format of disk support data ←←←←←←←←←←
	       B(1024) alcbuf0; allocation sector buffer 0|
	       B(1024) alcbuf1; allocation sector buffer 1|
	       H       dskstid; disk status sector (F1F1) |
	       H       dskcyls; number cylinders on disk  |
	       H       dskhds ; number of heads on disk	  |
	       H       dsksecs; number of sectors/track	  |
	       H       hdsecs ; number of sectors/cylinder| General
	       H       freesp ; sectors in free pool	  | Disk
	       W       dskdir ; pointer to directory	  | Data
	       H       swapsp ; number swap areas on disk |
	       W       swaptr ; pointer start swap space  |
	       H       reserv ; reserved		  |
	       W       dskusd ; total sectors used on disk|
	       W       dskdat ; date disk initialized←←←←←|
	       W       currd  ; disk reads		  |
	       W       curwr  ; disk writes		  |
	       W       curhsyn; header sync errors	  |
	       W       curhadr; header addr errors	  |
	       W       curhcrc; header crc errors	  | Current
	       W       curdsyn; data sync errors	  | Run
	       W       curdcrc; data crc errors		  | Statistics
	       W       curovr ; under/overruns		  |
	       W       curmemr; illegal memory acc errors |
	       W       cursker; seek errors		  |
	       W       curflt ; disk faults		  |
	       W       curxx  ; reserved←←←←←←←←←←←←←←←←←←|
	       W(2)    totrd  ; disk reads		  |
	       W(2)    totwr  ; disk writes		  |
	       W(2)    tothsyn; header sync errors	  |
	       W(2)    tothadr; header addr errors	  |
	       W(2)    tothcrc; header crc errors	  | Total
	       W(2)    totdsyn; data sync errors	  | Disk
	       W(2)    totdcrc; data crc errors		  | Statistics
	       W(2)    totovr ; under/overruns		  |
	       W(2)    totmemr; illegal memory acc errors |
	       W(2)    totsker; seek errors		  |
	       W(2)    totflt ; disk faults		  |
	       W(2)    totxx  ; reserved←←←←←←←←←←←←←←←←←←|




				  - 347 -





     DSKDATA(5)						    DSKDATA(5)



							←←←
	       H       alcbas0; allocation sector 0 base  |
	       H       alcsec0; alloc sector 0 disk adr	  |
	       H       alchn0 ; alloc sector 0 lock chain | Disk
	       H       alchne0;				  | Local
	       H       alcbas1; allocation sector 1 base  | Data
	       H       alcsec1; alloc sector 1 disk adr	  |
	       H       alchn1 ; alloc sector 1 lock chain |
	       H       alchne1;←←←←←←←←←←←←←←←←←←←←←←←←←←←|



     SEE ALSO

     getdsk(2)







































				  - 348 -





     EXE(5)						    EXE(5)


     NAME

     exe -- format of an 80286 executable file


     DESCRIPTION

     The output of the assembler, AS(1), is an executable file and can
     be  run  by  the  "frun" system call or by typing its name to the
     shell.  The format of an executable file is defined below.


     EXETYP [SEGCNT <maxsegs>] [FILCNT <maxfiles>] [STKCNT <stksize>]

     [SEGSTT <segtype> <seglen> [SEGDAT <offset> <len> <data>]...]...

     STTADR <offset> <seg> [SYMTAB <name> <symtype> <offset> <seg>]..

     where the field indicators are

	  EXETYP = F6F1 :defines 80286 executable file type
	  SEGCNT = F0F2 :initial segment count field
	  FILCNT = F1F2 :maximum open file count field
	  STKCNT = F2F2 :initial stack size field
	  SEGSTT = F3F2 :segment definitions for LDT entries 9 to n
	  SEGDAT = F4F2 :data entries for defined segments
	  STTADR = F5F2 :entry point of execution
	  SYMTAB = F6F2 :symbol definitions

     and field entries are

	  maxsegs = initial LDT size (default 32 entries)
	  filcnt  = maximum number of process open files (default 8)
	  stksize = initial stack size (default 512 bytes)
	  segtype = segment descriptor byte (F2,F3=data; FA,FB=code)
	  seglen  = (initial segment length)-1
	  offset  = offset into segment for code or data start
	  len	  = (length of data in bytes)-1
	  data	  = data for segment ((len)+1 bytes)
	  seg	  = segment selector for entry point
	  name	  = null terminated text string
	  symtype = {0=byte, 1=halfword, 2=word, 3=address, 4=string}













				  - 349 -





     EXEN(5)						    EXEN(5)


     NAME

     exen -- format of an NCUBE node executable file


     DESCRIPTION

     The output of the assembler, ASN(1), is an executable file and
	 can
     be run by ????













































				  - 350 -





     FILE(5)						    FILE(5)


     NAME

     file -- format of a data file


     DESCRIPTION

     A  data file consists of one file descriptor sector ("fildessec")
     and as many file pointer sectors ("filptrsec") as  necessary.   A
     file  descriptor  sector contains a 32 byte header and up to  248
     pointers to sectors containing data.   A file pointer sector also
     contains a 32 byte header and up to 248 pointers to data.


	  fildessec -- format of a file descriptor sector
	       H  ptrid	  ;non-ASCII value (F9F1) used for validation
	       B  filtyp  ;file type (see below)
	       B  subtyp  ;file sub-type (not interpreted by system)
	       W  nxtptr  ;disk address of the next pointer sector
	       H  filver  ;file version number (or device number)
	       H  filock  ;file lock (1=write, 2=read)
	       W  fildate ;file creation date
	       W  altered ;date file last altered
	       W  acssed  ;date file last accessed
	       W  filsiz  ;file size (0 to 4294967295 bytes)
	       H  filown  ;file owner number
	       H  acccnt  ;file access count
	       W  fdatptr ;first of up to 248 disk addresses of
			  ;sectors containing data (fdatptr = 0 is
			  ;an invalid pointer)


	  filtyp -- file type definitions (0 to 15 reserved for NCUBE)
	       C  nulfil = 0 ;
	       C  sysfil = 1 ;a system file
	       C  devfil = 2 ;a device file
	       C  binfil = 3 ;a binary data file
	       C  relfil = 4 ;a relocatable object file
	       C  exefil = 5 ;an executable file
	       C  txtfil = 6 ;a text (ASCII) file















				  - 351 -





     FILE(5)						    FILE(5)



	  filptrsec -- format of a file pointer sector
	       H  nextid  ;non-ASCII value (FAF1) used for validation
	       H  res	  ;reserved
	       W  nxtptr  ;disk address of next pointer sector
	       B(24) res  ;reserved
	       W  fdatptr ;first of up to 248 disk addresses of
			  ;sectors containing data



     SEE ALSO

     ed(1), dir(5), opntab(5)









































				  - 352 -





     OPNTAB(5)						    OPNTAB(5)


     NAME

     opntab -- format of an open file table


     DESCRIPTION

     Whenever a file is opened an open file descriptor ("opfildes") is
     created  and  entered into the open file table ("opntab") of  the
     process that invoked the "open file" call.   The call returns the
     index,  called the channel number or "fildes",  of the descriptor
     in the open file table.  Thereafter, file operations refer to the
     file  through this channel number.   An open file table  consists
     entirely  of open file descriptors so it suffices to specify  the
     format of the descriptors.

	  opfildes -- format of an open file descriptor
	       B  opnst	  ;open file status (see below)
	       B  opntyp  ;type of file (see below)
	       H  opndev  ;device table index for file
	       W  opnptr  ;disk address of first pointer sector for
			  ;file
	       W  opncpt  ;disk address of pointer sector for current
			  ;byte pointer
	       W  opnpos  ;current byte position in file
	       W  opnsec  ;disk address of sector for current byte
			  ;position
	       H  opnrgt  ;access rights for open file
	       H  opninx  ;index into pointer sector for current
			  ;sector
	       H  opndir  ;pointer to directory sector for file
	       H  opntem  ;temporary area
	       H  opntem2 ;temporary area
	       B  opnstps ;count of number of link jumps
	       B  opndpt  ;current depth of name search


	  opnst -- definition of open file status
	       C  open	  = 1 ;
	       C  altered = 2 ;

	  opntyp -- definition of open file type
	       C  file	 = 0 ; ---|  if most significant bit of opntyp
	       C  device = 1 ;	  |- is on, then the file is not on
	       C  pipe	 = 2 ; ---|  this system



     SEE ALSO

     file(5), open(2)




				  - 353 -





     PIPEOBJ(5)					       PIPEOBJ(5)


     NAME

     pipeobj -- format of a pipe object


     DESCRIPTION

     Pipes  are used to attach the standard output of one  process  to
     the  standard input of another.   The format of a pipe object  is
     given below.

	  pipeobj -- format of a pipe object
	       B(4096) pipbuf ;pipe buffer
	       H       pinptr ;pipe input pointer
	       H       potptr ;pipe output pointer
	       H       prdcnt ;number of pipe read opens
	       H       pwrcnt ;number of pipe write opens
	       H       prdchn ;chain of processes waiting on pipe read
	       H       prdchne;
	       H       pwrchn ;process chain waiting on pipe write
	       H       pwrchne;
	       H       piplen ;pipe segment length

































				  - 354 -





     PROCOBJ(5)					       PROCOBJ(5)


     NAME

     procobj -- format of a process object


     DESCRIPTION

     Each  process  in the system is represented by a  data  structure
     called  a process object.   The process object is represented  by
     four  entries in the Global Descriptor Table (GDT).   These  four
     entries  are collectively called the process descriptor  and  all
     process descriptors are chained together.   The first entry is an
     "invalid"  segment descriptor that contains process  information:
     a link to the next process descriptor in the chain,  process  id,
     priority  and status.  The other three entries are valid  segment
     descriptors.  A diagram of the structures is given below

		 GDT				   ←←←←←←←←←←←←
	 |		     |	     |----------->|	       |<---|
	 |		     |	     |		  |    TSS     |    |
      |--| link id prty stat |	     |		  |	       |    |
      |	 | TSS descriptor    |-------|		  |←←←←←←←←←←←←|    |
      |	 | LDT descriptor    |-----|		  |	       |    |
      |	 | procobj descriptor|--|  |		  |  PROCESS   |    |
      |	 |		     |	|  |		  |   DATA     |    |
      |	 |		     |	|  |		  |	       |    |
      |	 |		     |	|  |		  |←←←←←←←←←←←←|    |
      |->| link id prty stat |	|  |------------->|	       |    |
	 | TSS descriptor    |	|		  |    LDT     |    |
	 | LDT descriptor    |	|		  |	       |    |
	 | procobj descriptor|	|		  |←←←←←←←←←←←←|    |
	 |		     |	|				    |
	 |		     |	|-----------------------------------|




     The LDT format is:

	  0:  Read-only process object overlay
	  1:  System stack
	  2:  Workspace 1 (scratch space for the memory manager)
	  3:  Workspace 1 (used by the "frun" system call)
	  4:  Debug code segment
	5-7:  Debug data segments
	  8:  Process stack
	9-n:  Process code and data segments








				  - 355 -





     PROCOBJ(5)					       PROCOBJ(5)


     The  process descriptor and process object formats are  defined
     below.


	  process descriptor
	       H    pcsfwd	 ;offset in the GDT to next process
				 ;descriptor
	       H    pcsid	 ;unique identifier for the process
	       B    pprty	 ;scheduling priority
	       B    pnull	 ;=0 for invalid segment descriptor
	       H    pstatus	 ;see below
	       W(2) TSS desc	 ;descriptor for Task State Segment
	       W(2) LDT desc	 ;descriptor for Local Descriptor
				 ;Table
	       W(2) procobj desc ;descriptor for process object

	  pstatus
	       C run	  = 0  ;process is runnable
	       C tsserr	  = 1  ;invalid Task State Segment
	       C diverr	  = 2  ;divide overflow stop
	       C ovrerr	  = 3  ;integer overflow stop
	       C bnderr	  = 4  ;boundary error
	       C opcerr	  = 5  ;bad opcode
	       C nprerr	  = 6  ;No 80287 present
	       C doublerr = 7  ;double bit error
	       C exterr	  = 8  ;processor ext error
	       C stkerr	  = 9  ;stack overflow
	       C prterr	  = 10 ;protection error stop
	       C bufwat	  = 11 ;waiting for buffer
	       C dacwat	  = 12 ;waiting for device allocation
	       C secwat	  = 13 ;waiting for sector buffer
	       C dskwat	  = 14 ;waiting for disk operation
	       C trdwat	  = 15 ;waiting for tty read
	       C twrwat	  = 16 ;waiting for tty write
	       C mcpwat	  = 17 ;Master Control Process idle
	       C ptrwat	  = 18 ;waiting on printer
	       C cacwat	  = 19 ;waiting on disk cache
	       C logwat	  = 20 ;waiting on login initialization
	       C dsavwat  = 21 ;Disk Save Process wait
	       C piprwat  = 22 ;waiting on pipe read
	       C pipwwat  = 23 ;waiting on pipe write
	       C endwat	  = 24 ;waiting for process termination
	       C newpcs	  = 25 ;new process wait
	       C reserved = 26 ;reserved for NCUBE
	       C   :	    :  ;reserved for NCUBE (26 to 63)
	       C reserved = 63 ;reserved for NCUBE
	       C trcerr	  = 64 ;trace stop
	       C brkerr	  = 65 ;breakpoint stop
	       C dbgstp	  = 66 ;debug stop
	       C splwat	  = 67 ;spooler stop state





				  - 356 -





     PROCOBJ(5)					       PROCOBJ(5)


	  procobj -- format of a process object
	       B(44)  TSS     ;Task State Segment←←←←←←←←←
	       W      strtim  ;process start time	  |
	       H      cpustt  ;time at start of time slice|
	       H      newsflg ;new sector allocation flag |
	       W      cputim  ;execution time (.001 sec)  | Process
	       W      dskrds  ;disk read count		  | Statistics
	       W      dskwrs  ;disk write count		  |
	       W      iocnt   ;other I/O count (bytes)	  |
	       W      kcorsec ;kilo-core-seconds	  |
	       W      corsiz  ;memory size (Kbytes)	  |
	       W      cortim  ;mem size start time←←←←←←←←|
	       H      pcsown  ;process owner		  |
	       H      parent  ;process parent		  |
	       H      filmax  ;max open files (*32)	  |
	       H      segmax  ;LDT size			  | Process
	       H      privlg  ;privilege bits (see below) | Parameters
	       H      ldtadr  ;offset of LDT		  |
	       B(24)  pcsnam  ;process program name	  |
	       B(256) pcsdir  ;process preface		  |
	       B(256) insdir  ;current working directory←←|
	       H      devchn  ;chain for device wait	  |
	       H      alrmchn ;chain for alarm wait	  | System
	       W      alrmtim ;alarm time		  | Work
	       H      lckchn  ;chain for locks		  | Area in
	       H      pcswatid;process being waited on	  | Process
	       B(36)  devsav  ;device I/O data area	  |
	       B(24)  namsav  ;name work area		  |
	       H      lvlsav1 ;return save area		  |
	       H      lvlsav2 ;return save area←←←←←←←←←←←|
	       W      killvec ;kill process	    |
	       W      abrtvec ;abort (↑C)	    |
	       W      fpvec   ;floating point error |
	       W      intovec ;integer error	    |  Process
	       W      alrmvec ;alarm		    |  Interrupt
	       W      intvec  ;interrupt	    |  Vectors
	       W      protvec ;protection error	    |  (can be set
	       W      illvec  ;illegal instruction  |	by "vector"
	       W      bkptvec ;breakpoint	    |	system call)
	       W      trcvec  ;trace		    |
	       W      xx0vec  ;reserved		    |
	       W      xx1vec  ;reserved		    |
	       W      xx2vec  ;reserved		    |
	       W      xx3vec  ;reserved		    |
	       W      psevec  ;pause		    |
	       W      msgvec  ;message from process←|
	       B(94)  sav287  ;save area for 80287 status
	       B      vecflg  ;pending vector flag
	       B      lkflg   ;lookup mode flag
	       B(??)  opntab  ;open file table
	       B(??)  LDT     ;Local Descriptor Table




				  - 357 -





     PROCOBJ(5)					       PROCOBJ(5)


	  privlg (process privilege bits: 1=granted  0=denied)
	       bit  0:
	       bit  1:
	       bit  2:
	       bit  3:
	       bit  4:
	       bit  5:
	       bit  6:
	       bit  7:
	       bit  8:
	       bit  9:	delete links
	       bit 10:	create processes
	       bit 11:	kill processes
	       bit 12:	change memory size
	       bit 13:	create directories
	       bit 14:	create links
	       bit 15:	superuser (all rights)

     The  process statistics can be used for billing and are  accessed
     with the "getpcs" system call.  The process parameters are set at
     process  creation from the log on file or they are inherited from
     the  creating process.   The open file table contains  open  file
     descriptors.   Whenever  a file is opened a descriptor for it  is
     entered in this table and its index (channel number) is returned.
     Whenever  a new segment is allocated to a process,  a  descriptor
     for it is entered in the LDT.

     There  are  several  system variables that are  used  in  process
     management.  These include

	  system state
	  last process:	 a pointer to the last dispatched process; it
			 is used to implement round robin scheduling
	  process object:  the segment selector for the current
			   process object
	  time left:  the number of clock ticks left in the time slice
		      of the current process.



     SEE ALSO

     alarm(2),	frun(2),  endpcs(2),  endump(2),  getpcs(2), psend(2),
     pause(2), vector(2), sysdata(5), files(5)











				  - 358 -





     SYSDATA(5)						   SYSDATA(5)


     NAME

     sysdata -- format of system data file (/phy/systemdata)


     DESCRIPTION

     The  system data ("sysdata") defines the  parameters,  statistics
     and  variables of the system.   The data can be read by  invoking
     the system call "getsys".  The format of the system data is given
     below.



	sysdata -- format of the system data file←←←←←←←←←

	  H  sysid  ;sector id (F0F1) for validation	  |
	  H  basyr  ;base year for system date (1981)	  |
	  W  sysdate;system creation date		  |
	  H  memsize;main memory size ( /256 )		  |
	  H  timzon ;time zone correction factor	  | System
	  H  crashf ;system crash flag			  |Parameters
	  H  maxtmp ;maximum system temperature		  |
	  W  systemid;system and board id number	  |
	  H  sysbrd ;bits for active system boards	  |
	  H  grpbrd ;bits for active graphics boards	  |
	  H  arybrd ;bits for active array boards	  |
	  H  acctflg;accounting enable flag		  |
	  H  shut   ;system shutdown flag		  |
	  H  cacflg ;modified cache entry present flag	  |
	  H  taskflg;higher priority task waiting	  |
	  H  own287 ;process ID of current 80287 user	  |
	  B(220) res;reserved←←←←←←←←←←←←←←←←←←←←←←←←←←←←←|






















				  - 359 -





     SYSDATA(5)						    SYSDATA(5)



					     ←←←←←←←←←←←←←
	  W  lastim ;last system startup time		  |
	  W  stime  ;system startup time		  |
	  W  systim ;system overhead time		  |
	  W  idltim ;system idle time			  |
	  W  ecccnt ;ecc error count			  |
	  W  arytim ;array use time			  |
	  W  badcnt ;number unknown interrupts encountered|
	  W(2)totsys;total system overhead time		  | System
	  W(2)totidl;total system idle time		  |Statistics
	  W(2)totecc;total ecc error count		  |
	  W(2)totary;total array use time		  |
	  W(2)totbad;total unknown interrupts encountered |
	  W(2) totup;total system up time		  |
	  W  crhcnt ;system crash count			  |
	  H  tmpin  ;current temperature into system	  |
	  H  tmpout ;current temperature out of system	  |
	  H  ovrdiv ;overhead time divider (20)		  |
	  H  idldiv ;idle time divider (20)		  |
	  H  tempcnt;temperature sensor counter		  |
	  H  ovrcnt ;over-temperature reading count	  |
	  B(146) res;reserved				  |
	  H  temp0  ;current temperature readouts (0-15)  |
	  B(16) res ;reserved←←←←←←←←←←←←←←←←←←←←←←←←←←←←←|
	  H  kwncnt ;known (logged) system count	  | Known
	  B(254)kwntab;known system ID table←←←←←←←←←←←←←←|Systems
	  H  state  ;current system state		  |
	  H  curpcs ;pointer into GDT for current process |
	  H  pcsobj ;current process object seg selector  | System
	  H  bufptr ;pointer to start of memory buffers	  |Variables
	  H  lruptr ;pointer to sector buffer lru chain	  |
	  W  pcsptr ;branch pointer for process switch	  |
	  H  pcsctr ;ID for next process to be created	  |
	  H  gdtadr ;base address for GDT process table	  |
	  H  secflg ;sector buffer wait flag		  |
	  H  slist  ;sleeping processes linked list	  |
	  H  sliste ;end of list			  |
	  H  alist  ;processes with alarm set linked list |
	  H  aliste ;end of list			  |
	  H  slpdiv ;sleep timer divider (20)		  |
	  B(226)res ;reserved←←←←←←←←←←←←←←←←←←←←←←←←←←←←←|













				  - 360 -





     SYSDEV(5)						    SYSDEV(5)


     NAME

     sysdev -- device index definition


     DESCRIPTION

     Each device supported by the operating system has a set of device
     drivers to support it.   These routines are accessed through call
     tables  that  are indexed by the a unique number for each  device
     (see  below).   The  basic system  supports  the  disks,  8530's,
     8259's,  8254, array interface, printer and an sbx connected to a
     3M  tape  drive.   Additional drivers may be added if  other  sbx
     interfaces are installed in the system.

     The  device  calls are standardized for all devices.   They  are:
     init, open, read, write, alloc, special and seek.

     The device index definitions for the system are

	  0:  Null device
	  1:  sbx0 (tape drive if any)
	  2:  sbx1 (interboard bus if any)
	  3:  sbx2 (not defined)
	  4:  disk controller drive 0
	  5:  disk controller drive 1
	  6:  disk controller drive 2
	  7:  disk controller drive 3
	  8:  tty0
	  9:  tty1
	 10:  tty2
	 11:  tty3
	 12:  tty4
	 13:  tty5
	 14:  tty6
	 15:  tty7
	 16:  terminal broadcast
	 17:  printer
	 18:  hypercube array
















				  - 361 -






     5.3.2.6  Games



     The  NCUBE is supplied with a set of games and amusements.   They
     are found in the directory

			 /usr/games

     and are described below.















































				  - 362 -





     BAGELS(6)						    BAGELS(6)


     NAME

     bagels -- determine sequence from clues


     SYNOPSIS

     /usr/games/bagels


     DESCRIPTION

     In "bagels" (a game similar to Mastermind) the system chooses  at
     random (based on the real time clock) a sequence of  four  unique
     decimal digits (0-9).  It then displays

     "Guess 01:"

     to which you reply with your guess (e.g. 2307).  In order to help
     you narrow the possiblities,  the system gives you the  following
     clues in response to each guess:

	  pico:	   a correct value in the wrong position
	  fermi:   a correct value in the correct position
	  bagels:  no correct values

     When  you  type all four correct digits in the correct order  the
     system displays

     "That's It"

     and  asks if you want to play again.   If you type "no" you  will
     exit "bagels".  To exit at any other point, type "↑C".






















				  - 363 -





     LIFE(6)						    LIFE(6)


     NAME

     life -- cellular birth and death simulation


     SYNOPSIS

     /usr/games/life


     DESCRIPTION

     "life"  is  an intriguing game described in  the  book,  "Wheels,
     Life and Other Mathematical Amusements" by Martin Gardner, and in
     occasional  articles  in "Scientific American".   It  treats  the
     terminal  screen  as a two dimensional set of cells that  die  if
     they  have too many or too few neighbors and are born or continue
     to live if they have the right number of neighbors.

     When  you invoke "life",  the screen is cleared.   The  following
     commands allow you to move the cursor around,  creating cells for
     the initial pattern and to start and stop the generations.

	  space bar = invert cell
	  s = move left
	  f = move right
	  d = move down
	  e = move up
	  1 = go one generation
	  g = go full speed (any key will stop)
	  z = zero count and clear screen
	 ↑E = exit























				  - 364 -





     PERMUTE(6)						    PERMUTE(6)


     NAME

     permute -- display all permutations of a sequence


     SYNOPSIS

     /usr/games/permute


     DESCRIPTION

     "permute" displays all permutations of the input string.   If you
     give "permute" a string of nonsense letters, you will find out if
     any words can be spelled with exactly those letters.








































				  - 365 -





     ROSE(6)						    ROSE(6)


     NAME

     rose -- pattern generator


     SYNOPSIS

     /usr/games/rose


     DESCRIPTION
     "rose"  generates	interesting  patterns and sends	 them  to  the
     printer.	When  "rose" is invoked,  it asks you  for  a  pattern
     number.   If you type a  "0",  the pattern generated  will	 be  a
     chordal ring.   If you type a "1",	 the pattern will be a	linear
     version of a chordal ring.	  If you type "2",  a rotating pattern
     will be generated,	 but first more questions will be asked.   The
     first is

     X rotation?

     to	 which	you respond with an integer "k" that will be  used  to
     determine	the  amount to rotate the figure on  each  pass.   The
     amount is
			    k*(1/256)
     of a circle.

     Then  it  will ask for the number of points,  expecting a  number
     from 1 to 5 inclusive.  The meaning of the numbers is given below
     but the only way to comprehend their meaning is to try them.

	       1 = a point
	       2 = a line
	       3 = a wedge
	       4 = a four sided figure
	       5 = a five sided figure

     To exit "rose" at a random time, type "↑C".

















				  - 366 -






     5.4  Communication System (VORTEX and VERTEX)

     There  are  two  communication  systems  in  the  NCUBE software.
     VORTEX runs in the Host Board and is used to manage  the  message
     queue and communicate with the allocated subcubes.  It appears to
     the user simply as an extension  of  AXIS.   VERTEX  is  a  small
     nucleus  that  runs in each of the nodes and provides control and
     message handling facilities.  VERTEX also cooperates with  VORTEX
     and  AXIS  to  provide  a  parallel debugging environment for the
     hypercube nodes.


     5.4.1  Messages

     The primary facilities in the NCUBE communication systems are for
     handling  messages.   A  message is simply an array of bytes with
     four associated  attributes:   source,  destination,  length  and
     type.   The  source is the sender of the message.  It is supplied
     automatically by a "write" (send) operation and is returned by  a
     "read"  (receive)  operation.   The destination of a message is a
     parameter in a "write" operation.  Sources and  destinations  are
     16  bit  numbers and for communication within the hypercube, they
     have values from 0 to 1023.  These numbers designate logical node
     numbers.   Nodes  on  the  Host Board have "negative" values (the
     most significant bit is one).  In order to send a message from  a
     hypercube  node  to  the  Host, you first call WHOAMI (see below)
     which returns the designated node number for Host  communication.
     You  then  use  that number as the destination in all messages to
     the Host.  The length attribute is the length  in  bytes  of  the
     message.   In  this  version length must be less than 65527.  The
     type of a message is also a 16 bit value.   There  are  two  main
     classes  of  types,  system  types  and  user types.  If the most
     significant bit is one, it is a system type; otherwise  it  is  a
     user  type  and  is not interpreted by the system.  Messages with
     system types are trapped by VERTEX and VORTEX and are used  among
     other things for debugger information.  System types are reserved
     and, with  two  exceptions,  should  not  be  used  by  in  NCUBE
     programs.   One  exception  is  the  use  in NREAD and NTEST (see
     below) of "-1" to designate "don't care" for the source or  type.
     The  other  exception  is  for loading programs on the nodes.  To
     load a program, you first read a file  in  the  NCUBE  executable
     format (see EXEN(5)) into memory and then write it to a node.  In
     order to tell VERTEX on the node to shut down the current process
     and  to  load  the message as a program and start it running, you
     must send it with system type 7  (8007  in  hex).   One  powerful
     facility supplied by the type (and source) attributes is that the
     "read" (receive) functions can selectively receive messages  from
     designated sources with designated types.









				  - 367 -





     5.4.2  VORTEX

     VORTEX  looks  to the user like an extension to AXIS for handling
     the device "/dev/ncube".  A subcube is allocated with the "fopen"
     call  and  deallocated  with  "fclose".   Messages  are  sent and
     received with "fwrite" and "fread", respectively.  And one of the
     "special" operations is "test for message".  The details on these
     system  calls  is  in  section  5.3.2.2.   One  important  common
     characteristic  is  that they are "blocking" functions and do not
     return until the operation has completed.

     Debugging is also  a  facility  provided  by  VORTEX  through  an
     extension  of  the  AXIS  debugger.   You can put the debugger in
     "node mode", select a particular  node  and  then  the  functions
     available  are essentially the same as for debugging processes in
     the Host (80286).	For details see ADB(1) in section 5.3.2.1.


     5.4.3  VERTEX

     The communication system that runs in each of the nodes is called
     Vertex.  It provides communication and process control functions.
     The details are contained in the system call  descriptions.   The
     calls are listed below and each is described in detail in its own
     section.


     BREAKPOINT:  stop process (2)
     NENDPCS:	  terminate process (130)
     NREAD:	  receive message (134)
     NTEST:	  test for message (137)
     NTIME:	  return time since node initialization (129)
     NWRITE:	  send message (133)
     WHOAMI:	  return identifying parameters (128)
























				  - 368 -





     BREAKPOINT(2)				       BREAKPOINT(2)


     NAME

     breakpoint -- stop process


     SYNOPSIS

     breakpoint


     DESCRIPTION

     "breakpoint" is a "trap 2" which causes the process to stop.


     ASSEMBLER

     breakpoint = 2

     entry:
     no parameters

     trap breakpoint

     exit:
     all registers saved





























				  - 369 -





     NENDPCS(2)					     NENDPCS(2)


     NAME

     nendpcs -- terminate process


     SYNOPSIS

     nendpcs


     DESCRIPTION

     "nendpcs"  terminates  the  calling  process  and  releases   all
     resources.


     ASSEMBLER

     nendpcs = 130

     entry:
     no parameters

     trap nendpcs

     exit:
     does not return




























				  - 370 -





     NREAD(2)					     NREAD(2)


     NAME

     nread -- receive message


     SYNOPSIS

     nread(length,message,source,type,status,error)


     DESCRIPTION

     "nread"  accepts the next available message whose source and type
     are compatible with the "source" and "type" parameters  into  the
     buffer  "message".   If  "source"  is  -1 then a message from any
     source will  be  accepted.   Otherwise  only  messages  from  the
     specified   source   will  be  read.   Similarly  with  the  type
     parameter:  if "type"  is  -1  then  any  type  message  will  be
     accepted.   Otherwise  the  message type must match the parameter
     "type" to be accepted.  The actual source and type of the message
     are  stored  at "source" and "type" respectively.  If the message
     is longer than "length", only the first part ("length" bytes)  is
     received.   "nread"  is  a  blocking function and does not return
     until the message is received  or  an  error  is  returned.   The
     "status" parameter is for a future non-blocking receive function.


     ASSEMBLER

     nread = 134

     entry:
     R0 = "length" (length in bytes of the message buffer)
     R1 = "source" requested (-1 is do not care)
     R2 = "type" requested (-1 is do not care)
     R3 = pointer to "status" byte
     R4 = pointer to "message" buffer

     trap nread

     exit:
     Carry = true if error
     R0 = error number if error else actual message length
     R1 = actual message source
     R2 = actual message type
     all other registers saved









				  - 371 -





     NTEST(2)					     NTEST(2)


     NAME

     ntest -- test for message


     SYNOPSIS

     ntest(source,type,length,error)


     DESCRIPTION

     "ntest" is essentially the same as "nread" except  that  it  only
     checks  for  the  presence of a message whose source and type are
     compatible with the "source" and "type" parameters  (-1  in  both
     cases  is  "don't  care").   If  there  is  a compatible message,
     "ntest" returns its  actual  source,  type  and  length.   If  no
     compatible message is pending, an error is returned.


     ASSEMBLER

     ntest = 137

     entry:
     R1 = "source" requested (-1 is don't care)
     R2 = "type" requested (-1 is don't care)

     trap ntest

     exit:
     Carry true if error
     R0 = error number if error else length of found message
     R1 = actual message source
     R2 = actual message type
     all other registers saved



















				  - 372 -





     NTIME(2)					     NTIME(2)


     NAME

     ntime -- return time since node initialization


     SYNOPSIS

     ntime(time)


     DESCRIPTION

     "ntime"  returns  a  measure  of  the  time  since  the  node was
     initialized.   To  convert  the  time  to  seconds,  multiply  by
     (N/1024) where N is the clock rate in Mhz.


     ASSEMBLER

     ntime = 129

     entry:
     no parameters

     trap ntime

     exit:
     R1:R0 = "time"
     all other registers saved


























				  - 373 -





     NWRITE(2)						   NWRITE(2)


     NAME

     nwrite -- send message


     SYNOPSIS

     nwrite(length,message,dest,type,status,error)


     DESCRIPTION

     "nwrite"  takes  the data in the "message" buffer, copies it into
     the VERTEX buffer and sends  it  (along  with  its  "length"  and
     "type")  to the destination indicated by "dest".  "nwrite" blocks
     until the message has been copied so when it returns the  message
     buffer  can  be  reused.   The "status" parameter is for a future
     non-blocking send function.


     ASSEMBLER

     nwrite = 133

     entry:
     R0 = "length" of message in bytes
     R1 = pointer to "message" buffer
     R2 = pointer to "status" byte
     R3 = "type" of message (16 bits)
     R4 = "dest" (message destination)

     trap nwrite

     exit:
     Carry = true if error
     R0 = error number if error
     all other registers saved


















				  - 374 -





     WHOAMI(2)						WHOAMI(2)


     NAME

     whoami -- return identification parameters


     SYNOPSIS

     whoami(node,process,host,dim)


     DESCRIPTION

     "whoami" returns four identification parameters:
	 "node":     logical node number of the calling process
	 "process":  process number of the calling process
	 "host":     id number for host communication
	 "dim":	     allocated subcube dimension


     ASSEMBLER

     whoami = 128

     entry:
     no parameters

     trap whoami

     exit:
     R0 = "node"
     R1 = "process"
     R2 = "host"
     R3 = "dim"
     all other registers saved





















				  - 375 -





     6	System Management

     In  this  chapter  we will include all the  details  involved  in
     operating and maintaining an NCUBE system.



     6.1  System Specifications

     An  NCUBE/ten  system  must  be  installed in accordance with the
     following specifications.


	  Size:	 An NCUBE/ten system including one peripheral cabinet
		 measures 34 inches high by 52 inches wide by 35
		 inches deep and requires open floor space of 72
		 inches wide by 72 inches deep for access to hardware
		 components.

	  Power:  The power cord is 10 feet long with a NEMA 6-50P
		  plug.	 The system requires 230 volt (10%), 50 amp,
		  single phase power.

	  Cooling:  The ambient temperature must be maintained below
		    25 degrees Centigrade.  A complete (24 board)
		    system dissipates approximately 8 kilowatts.

	  Terminals:  Each Host Board has 8 RS-232 serial channels for
		      terminals or other serial devices.  They are
		      accessed through standard 25 pin female
		      D-subminiature connectors on the back of the
		      system enclosure.

	  Printers:  Each Host Board has one Centronics compatible
		     parallel port.  It is accessed through a 37 pin
		     female D-subminiature connector on the back of
		     the system enclosure.





















				  - 376 -





     6.2  System Operation

     This  section will cover the common operating procedures for  the
     NCUBE  system.   In the front of the system enclosure  there  are
     three  switches with indicator lights and three status lights  as
     shown below.

       |---------|---------|---------|---------|---------|---------|
       |  POWER	 |  POWER  |	     |	       |  STATUS |  STATUS |
       |   UP	 |  DOWN   |   DIAG  |	 RUN   |    1	 |    2	   |
       |	 |	   |	     |	       |	 |	   |
       |---------|---------|---------|---------|---------|---------|

     These  switches  and  lights are the main control panel  and  are
     referred to in some of the procedures described below.



     6.2.1  Power Up

     The system power cord should be plugged in,  the circuit  breaker
     and the pilot light on the back of the system enclosure should be
     on  and the console terminal should be turned on and connected to
     channel 0 on Host Board 0.

     The  system can be powered on in two modes:   the Normal mode and
     the  Diagnostic mode.   The mode is determined by the setting  of
     the switch labeled "DIAG".   If the switch indicator light is on,
     then the mode is Diagnostic.   To power up in Normal  mode,  make
     sure  the light is out.   After selecting the desired  mode,  the
     system  is powered on by pushing the switch labelled "POWER  UP",
     holding  it down until the light comes on and then releasing  it.
     Regardless of the mode setting the system will first run a set of
     diagnostics that take about 15 seconds.   If the diagnostics fail
     the  memory  test or if the mode is Diagnostic,  the system  will
     come up in the ROM Monitor.  If the mode is Normal but the system
     fails  a later test,  it will come up in the RAM  Monitor.   (See
     section  5.2 for more detail on the diagnostics and the Monitor.)
     If the system is in Normal mode and passes the  diagnostics,  the
     operating system will boot and the message

	  NCUBE Peripheral Disk System

     will  be displayed.   In order to get the logon message type "↑C"
     (several times if necessary).













				  - 377 -





     6.2.2  System Reset


     The  last resort for a hung system is the reset  switch.   First,
     try  typing "↑C" several times slowly.   If the system  does  not
     respond, it can be reset by opening the system enclosure door and
     flipping  the  "reset" rocker switch on the inside of the  status
     board.   This will cause a system crash followed by a boot of the
     operating system.  Some status messages will be displayed because
     of  the  crash concerning bad access  counts.   However,  if  the
     operating system successfully boots,  it will have cleaned up any
     problems caused by the crash.



     6.2.3  Power Down


     There are three ways to power the system down.   The  recommended
     power down procedure from the Shell is as follows

	  Type "shut #"	 After # minutes this terminates all
	 processes,
			 logs everyone off and invokes the RAM
	 Monitor.
			 The user must be a superuser.	At this point
			 all of the Monitor functions are available
			 including file backup.

	  Type "xp<CR>" to turn off the machine physically.
	       (The fans will run for about 1 minute after the system
		is powered down.)


     Another way to power down the system is to simply push the "POWER
     DOWN" switch and hold is down until it lights (about 10 seconds).
     If  this  is done while the operating system  is  functioning,  a
     normal "shut" as described above occurs.  If the system is in the
     Monitor, it is simply powered off.

     An  emergency  method for power down is to flip the main  circuit
     breaker.   This should be done in an emergency only.  No hardware
     damage will result but some files may be lost.















				  - 378 -





     6.2.4  Start Up and Configuration


     When the operating system boots it looks for a file called

	       /sys/startup

     If this file exists, a shell is created that runs it as a command
     file.   This allows the system to be configured as desired by the
     system administrator.  The default startup file has the following
     command.


	  /sys/bin/spool > /sys/spool.log &

	       This causes the print spooler to be run as a process in
	       parallel with all other processes.  The list of printed
	       files is put in "spool.log".


     One  way  this  file can be used is for  setting  serial  channel
     characteristics.  The default baud rate is 19200 baud, but if you
     want  channel  3  to  run at 9600  baud,  you  should  enter  the
     following command into the startup file

	  stty -tty 3 -baud 9600
































				  - 379 -





     6.2.5  Tape Backup and Restore

     The "tbr" command (see TBR(1)) is used for tape  backup,  restore
     and certification.  Before a tape can be used for backup, it must
     be  formatted  and  checked for bad  blocks  ("certified").   The
     procedures for tape certification,  backup and restore are  given
     below.

	  NOTE:	 The current tape system holds about 65 Megabytes per
	  tape.	 If you try to write more data than the tape can hold,
	  the result will not be good.	This will be fixed in the
	  future to allow a backup to span more than one tape.



     CERTIFICATION

	  Mount the tape in the tape drive.

	  Type "tbr -wc <CR>".

	  Tape certification takes about one hour and destroys all
	  data on the tape.  It is only necessary to certify a tape
	  once.

     Assuming a certified tape exists, we will now give the procedures
     for backup and restore.



     BACKUP

	  Mount the tape in the tape drive.

	  Type "tbr -wlu -b name1 as name2 <CR>"

     If  "name1" is a directory,  "tbr" will save all the files in the
     tree.   For  a  full backup,  use the name of the disk  root  for
     "name1"   (usually  you  will  give  "name2"  as  something  that
     indicates its date,  e.g.  "disk0back031585").  The saved file or
     directory  will be named "name2" on the tape.   If you  omit  "as
     name2",  the name on the tape will be "name1".   After the backup
     function  is  performed,  the new directory on the tape  will  be
     displayed (because of the "-l" option).  Then because of the "-u"
     option,  the  tape will be unloaded and you can remove  it.   The
     command  as  given  above will erase whatever is already  on  the
     tape.   If you want to append the new data to the end of what  is
     already on the tape, simply include an "-a" option in the command
     as shown below.

	       tbr -walu -b name1 as name2







				  - 380 -






     RESTORE

	  Mount tape in tape drive.

	  Type "tbr -wu -r name1 as name2<CR>"

     The  file "name1" (or tree if "name1" is a directory) on the tape
     will be stored on the disk as "name2".  If "as name2" is omitted,
     "name1" will be used.   After the restore is finished,  the  tape
     will be unloaded and you can remove it.

     NOTE

     If you forget what is on a tape simply type

	  "tbr -wl<CR>"

     and the directory on the tape will be displayed.







































				  - 381 -






     6.2.6  User Accounts


     User accounts are created by a superuser typing

	       /sys/bin/edusr

     and then using the command language of "edusr" to create and edit
     "logon" files.   "edusr" is used to create files in the directory
     called

	       /sys/acct

     which  contains  all  the user logon files.   Each entry  in  the
     "acct"  directory  is  a 1024 byte ascii file  in  the  following
     format (all fields are terminated by a blank).


	  0) username (same as in "usrlist")
	 24) password
	 48) user number (index in hex in usrlist)
	 52) privilege bits
	 56) reserved (to 127)
	128) full user name and data
	256) initial user program
	512) preface directory
	768) initial working directory

     Privilege bits:

	 15) Super user
	 14) Create links
	 13) Create directories
	 12) Change memory size
	 11) kill processes
	 10) create processes
	  9) delete links
	  8) create files
	7-0) reserved


     The  commands  in	"edusr" are described  below.	A  command  is
     invoked by typing the first letter of its name.














				  - 382 -





     EDUSR COMMANDS


     add user <username>

	  This command is used to add a new user account to the
	  system.  It creats a new file and inserts "username" in its
	  first field.	A series of questions are asked in order to
	  fill in the other fields.  These questions are listed below
	  with typical responses.

	       password?	    enter the initial password
	       superuser?	    "y" or "n"
	       user data?	    anything up to 128 characters
	       initial program?	    usually "/bin/nsh"
	       file preface?	    usually blank
	       working directory?   usually "/usr/username"

	  After answering these questions, the system displays all
	  the answers and asks

	       add user to system?  "y" ("n" if something is wrong)


     change password for user <username>

	  A new password may be entered.


     help

	  The edusr commands with their parameters are displayed.


     list users

	  The list of currently authorized usernames is displayed.


     modify user <username>

	  The entries in the logon file may be modified.
















				  - 383 -






     quit

	  Exit from edusr.


     remove user <username>

	  The logon file for "username" is deleted from the system.


     show user <username>

	  The contents of the logon file for "username" are listed.












































				  - 384 -






     7	Tutorial


     7.1  Introduction

     In  order  to  program the NCUBE system effectively a  user  must
     think  of  his problem as a set of  smaller  problems.   In  some
     applications, particularly  in  the physical  sciences,  this  is
     relatively   easy.   Most  scientific  problems  involve  solving
     equations in a 2 or 3 dimensional space and one can simply divide
     the  space  into   pieces   and   solve  the  equations in  these
     divided  spaces matching  the   solutions   at  the  edges.    In
     other  applications dividing  the problem into smaller pieces may
     not be as  straight forward.   However, almost all large problems
     must  be  subdivided,  just   to   be   manageable.    So  we are
     confident  that  a  large proportion of important problems can be
     solved effectively on the NCUBE system.

     One  difference between the NCUBE system and the more traditional
     "pipelined"  approach to high performance computing is  that  one
     must  divide  both the program and the data into smaller  pieces.
     This  is  sometimes  more  difficult than  having  many  programs
     working on a large shared memory,  but it more accurately  models
     the real physical world of local phenomona.   It is also the only
     way  to  overcome  the memory speed bottleneck of  shared  memory
     systems.

     In  this tutorial we will illustrate how to solve a set of  model
     problems  on the NCUBE system.   The programs are fragments  only
     and  should  not  be taken as  finished  routines.   The  set  of
     problems include:

	  vector product
	  fast fourier transforms
	  simultaneous linear equations
	       dense--QR and LU decompositions
	       sparse--Conjugant Gradient iteration
	  systems of ordinary differential equations
	  partial differential equations
	  jacknife or bootstrap (statistics)

     Since  many  of  the  problems that we  will  discuss  require  a
     modification  of  the hypercube interconnection scheme,  we  will
     first  describe  how  to map the hypercube  onto  some  of  these
     interconnection patterns.












				  - 385 -





     7.2  Hypercube Mappings

     The  hypercube  interconnection system was chosen for three  main
     reasons:  (1) It is an inductive structure and so it will usually
     be  easy to  write  programs  that are independent of  the  order
     of   the  hypercube.    This   also  facilitates  time  and space
     sharing by the operating system.  (2) It   maps   directly   onto
     the   most  important    common  interconnection  patterns  (i.e.
     1,2,3,4  dimensional  lattices,  "perfect  shuffle"  and  trees).
     (3)  It  is  so  extensively interconnected that it gives a  good
     approximation  to  maximal  (every  processor  connected  to  all
     others)  interconnection.   Thus,  if a problem does not have  an
     obvious interconnection structure, it will normally be acceptable
     to  assign subproblems arbitrarily to hypercube nodes and let the
     communication software take care of routing messages.

     Since  many  physical problems split naturally onto  lattices  we
     will  describe algorithms for mapping the hypercube onto grids up
     to  dimension 4.  (We will also descibe the mappings for  perfect
     shuffles and trees.)


     7.2.1  Gray Code

     All  of  the hypercube mappings are most easily  described  using
     some variant of Gray code.   A gray code is a one to one  mapping
     between  integers  such  that the binary representations  of  the
     images  of  any two consecutive integers differ  in  exactly  one
     place.   The  domain is assumed to be finite and the largest  and
     smallest  integers in the domain are "consecutive".   One example
     of a gray code for three bit integers is

	  0  000  -->  000  0
	  1  001  -->  001  1
	  2  010  -->  011  3
	  3  011  -->  010  2
	  4  100  -->  110  6
	  5  101  -->  111  7
	  6  110  -->  101  5
	  7  111  -->  100  4

     One  may  intuitively  see  that a  gray  code  is  important  by
     realizing  that  in a hypercube,  if processor x is connected  to
     processor  y,  then  the binary representations of x and  y  must
     differ  in  exactly  one place.   There is  a  unique  gray  code
     implemented with the following algorithm:

	  1) let x be a nonnegative number represented in binary
	  2) let y be x after a right shift by one place
	  3) then z = x XOR y is the gray code image of x








				  - 386 -





     The  NCUBE  code  to  implement  this algorithm  is  (X  must  be
     nonnegative):

	  MOVW	X,R0
	  SFTW	#-1,R0
	  XORW	X,R0
	  MOVW	R0,Z

     As will be seen below,  the inverse mapping is also  needed.   In
     other  words if z is a gray code image we will need to be able to
     calculate the value x whose gray code is z.   The inverse mapping
     for  the  gray code algorithm given above is implemented  in  the
     following NCUBE code:

	  MOVW	Z,R0
	  MOVW	R0,R1
	  SFTW	#-1,R1
     L:	  XORW	R1,R0
	  SFTW	#-1,R1
	  BNE	L

     Although  the gray code above is unique,  there are many mappings
     between  integers that have the property of  mapping  consecutive
     integers  to images that differ in one place.   Any such  mapping
     can be used in the algorithms described below.


     7.2.2  One Dimensional Grid

     A   one  dimensional  grid  (or  ring)  is  simply  a  string  of
     interconnected processors as shown

	 O ----- O ----- O ----- O ----- O ----- O ----- O ----- O
	 |							 |
	 |←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←←|

     This  interconnection is often useful when the problem  does  not
     have  to  solved in real time and can be broken down  into  steps
     that  can  be pipelined.   Non-realtime filtering is an  example.
     The mapping in this case is simply any gray code as described  in
     section 7.2.1.   Thus, if G is the gray code and F is its inverse
     then the neighbors of processor x are

		     G(F(x)-1) and G(F(x)+1).














				  - 387 -





     7.2.3  Two Dimensional Grid

     Steady  state  problems  involving  two  space  dimensions  (e.g.
     boundary  value  problems) map naturally onto a  two  dimensional
     grid.   To define a two dimensional mapping, assume that the grid
     is  2**M in the x direction by 2**N in the y direction,  then the
     processor number at location (x,y) is

			      2**M*G(y)+G(x).

     Also, if a processor number is k=2**M*z+w then its neighbors are

	       2**M*G(F(z))+G(F(w)-1) = 2**M*z+G(F(w)-1)
	       2**M*G(F(z))+G(F(w)+1) = 2**M*z+G(F(w)+1)
	       2**M*G(F(z)-1)+G(F(w)) = 2**M*G(F(z)-1)+w
	       2**M*G(F(z)+1)+G(F(w)) = 2**M*G(F(z)+1)+w

     By  using a slightly more complicated scheme where neighbors  are
     determined  by shuffling the bits of the images one has a mapping
     where the neighbors of k are fixed independent of the size of the
     hypercube.


     7.2.4  Three Dimensional Grid

     Many  real  physical problems are mapped onto  three  dimensional
     grids.   An example is fluid flow whether in airplane wing design
     (turbulent,   compressible   flow)  or  oil  reservoir   modeling
     (incompressible flow).   A three dimensional mapping is analogous
     to  the two dimensional case except the processor ID numbers  are
     divided  into  three  parts  instead of two  and  there  are  six
     neighbors instead of four.


     7.2.5  Four Dimensional Grid

     If a problem involves both time and space it may be  conveniently
     mapped onto a four dimensional grid.  In this case a processor ID
     number  is  divided into four parts and each processor has  eight
     neighbors.


     7.2.6  Perfect Shuffle

     The  perfect shuffle is an important interconnection  scheme  for
     some   algorithms  (for  example  some  fast  fourier   transform
     algorithms	 use  perfect  shuffle	communication).


     7.2.7  Trees

     Most kinds of trees can be mapped onto a hypercube.






				  - 388 -





     7.3  Computational Examples

     In  this section we will illustrate NCUBE programming by  showing
     how  to  solve  some  model problems.   These  problems  will  be
     simplified  and  therefore  not necessarily  applicable  to  real
     physical  situations  but  they will  serve  to  demonstrate  the
     approach  without obscuring the main points with too many special
     cases.


















































				  - 389 -





     7.3.1  Vector Product

     The first example is very simple:   compute the sum of squares of
     a  long vector.   This is done by assigning an equal part of  the
     vector  (if  possible)  to each  node.   Each  node  computes  in
     parallel  the sum of squares of its part of the vector.   Then  a
     "dimensional  collapse" starts where the computed values are sent
     by the higher numbered processor to the lower numbered  processor
     in  each  dimension of the cube and the lower numbered  processor
     adds  the value received to its current  value.   This  continues
     until  the  complete sum of squares is contained in processor  0.
     The "code" for this algorithm is given below.














































				  - 390 -





		    CALCULATE  SUM ( V(I)**2 )

			 NODE PROGRAM

     *PN   : caller's logical processor number in subcube
     *PROC : process number in node
     *HOST : node on Host for cube communication
     *M	   : order of allocated subcube

	  CALL WHOAMI (PN,PROC,HOST,M)

     *receive vector V of length N from Host

	  SR = NREAD (V,N,HOST,TYPEH,FLAG1)

     *compute sum of subset of V that is in this node;

	  S = 0
	  DO 1	I = 1,N
      1	       S = S + V(I)**2

	  DO 2	I = M,1,-1

     *execute once for each axis of the hypercube;

	       IF (PN .LT. 2**I) THEN

     *if this node is in the active part of the collapsed cube,
     *do the computation below, otherwise the computation is done
     * NPN is neighbor of PN in (I-1) axis

		    NPN = PN .NEQV. (2**(I-1))
		    IF (NPN .LT. PN) THEN

     *if neighbor's number is less, send the current accumulation;
     *otherwise, receive it and update its value

			      SW = NWRITE (S,4,NPN,TYPEN,FLAG2)
			 ELSE
			      SR = NREAD (A,4,NPN,TYPEN,FLAG3)
			      S = S + A
		    ENDIF
	       ENDIF
      2	  CONTINUE

     *send final result back to host

	  IF (PN .EQ. 0) SW = NWRITE (S,4,HOST,TYPEH,FLAG4)










				  - 391 -





     7.3.2  Fast Fourier Transforms
     The  fast  fourier  transform is similar to  the  vector  product
     except  that  data  is exchanged along the axes  instead  of  the
     dimensionality collapsing.  As before the data is divided between
     the  processors  (it  must  be sent out in  order)  and  as  many
     "butterflies"  as possible are computed locally and in  parallel.
     Then, along each axis in turn, half the data is exchanged and one
     butterfly is computed.  The code for this is given below.


	       FAST FOURIER TRANSFORM NODE PROGRAM

	  CALL WHOAMI (PN,PROC,HOST,M)
	  CALL NREAD (A,N,HOST,TYPEH,FLAG1)
	  L = N / 2
	  LP = L + 1

     *compute as much of the FFT as possible without communication

	  DO K BUTTERFLY LOOPS

	  DO  10  I = 0,M-1

     *execute once for each axis of the hypercube

	       NPN = PN .NEQV. (2**I)
	       IF (PN .LT. NPN) THEN

     *send the first half of A and replace with neighbor's last half

			 SW = NWRITE (A(1,L),L,NPN,TYPEN,FLAG2)
			 SR = NREAD (A(1,L),L,NPN,TYPEN,FLAG3)
		    ELSE

     *otherwise, send the last half of A and replace with neighbor's
     *first half

			SW = NWRITE (A(LP,N),L,NPN,TYPEN,FLAG4)
			SR = NREAD (A(LP,N),L,NPN,TYPEN,FLAG5)
	       ENDIF

	       DO ONE BUTTERFLY LOOP HERE

      10  CONTINUE

     *send the transformed (and scrambled) vector to the host

	  SW = NWRITE (A,N,HOST,TYPEH,FLAG6)










				  - 392 -





     7.3.3  Simultaneous Linear Equations

     The solution of simultaneous linear equations is a very important
     and pervasive problem in numerical computation.   The problem has
     been  studied extensively and there are well behaved methods  for
     most of the different types of linear equations.  Linear equation
     problems are categorized according to the structure of the matrix
     representing the problem.	The two main types are
	  1)  dense--where the matrix is mostly full of nonzero
		     elements and
	  2)  sparse--where the matrix is mostly zero.
     Within these categories matrices are further subdivided into
	  1)  general--where the matrix elements have no special
	      structure and
	  2)  symmetric, positive definite--where the matrix elements
	      are symmetric across the main diagonal and the
	      determinants of all the principal minors are positive.

     In this section we will show how to program four methods:

	  1) Dense, general:  QR method
	  2) Dense, general:  Gaussian elimination
	  3) Dense, symmetric, positive definite:  Cholesky method
	  4) Sparse, symmetric, positive definite:  Conjugate Gradient

     The first three methods involve computing factors of a matrix  so
     that the problem is solvable in two steps.   For example, suppose
     we want to solve

			 Ax = b

     where A is the matrix of coefficients,  x is the unknown and b is
     the known vector.	In the factorization methods we compute

			 A = CD

     where  C  and  D  have  some  special  structure  (orthogonal  or
     triangular).   Then  the equations are solved by computing y  and
     then x as shown

	       Cy = b
	       Dx = y

     The structure of C and D make the systems above easy to solve.














				  - 393 -





     7.3.3.1  Hypercube Mapping

     In the algorithms for dense matrices we will break up the  matrix
     into equal rectangles (as close to squares as possible).  We will
     also map the hypercube onto a two dimensional grid.  Thus, in the
     ideal case where there are M**2 processors and the matrix is N by
     N,  then  we  would  put  subblocks of size N/M by  N/M  in  each
     processor.  The process is illustrated below where the subscripts
     refer to both the subblock of the matrix and to the processor.

	      ←←	     ←←
	      |A11 A12 ... A1M|
	      |A21 A22 ... A2M|	 the processor Pij contains the
	  A = | :   :  ...  : |	 subblock Aij and the neighbors of
	      | :   :  ...  : |	 Pij are:
	      | :   :  ...  : |	   Pi+1j, Pi-1j, Pij+1, Pij-1
	      |AM1 AM2 ... AMM|
	      --	     --


     7.3.3.2  QR Method

     The  QR  method  factors  the matrix A into  the  product  of  an
     orthogonal  matrix,  Q (Inverse Q = Transpose Q),  and  an  upper
     triangular  matrix,  R.   Although  the  method  is  slower  than
     Gaussian  elimination it is more stable and can be used to  solve
     Linear Least Squares problems.   (When the matrix A has more rows
     than columns the problem is referred to as a Linear Least Squares
     problem.)   There are two ways to compute the  QR  factorization.
     One  uses  plane  rotations (Given's method) and the  other  uses
     Householder transformations.


     7.3.3.3  Gaussian Elimination

     Gaussian elimination with partial pivoting is a relatively stable
     and  fast  method to solve a set of dense linear  equations  that
     have no special structure.   This method computes a factorization
     of A called LU (i.e.  A = LU where L is lower triangular and U is
     upper  triangular).

     The  following  program computes L and U (to  simplify  the  code
     pivoting  is  left out).   The example uses elimination  starting
     from the upper left and working down the diagonal.   This results
     in  the  triangularization shown below.   It is  poorly  balanced
     since  as soon as a processor on the diagonal has  triangularized
     its  block,  all  the processors in its row and column  go  idle.
     There is a more balanced algorithm given later; this one is first
     because it is slightly simplier.









				  - 394 -





	     LINEAR EQUATIONS --- UNBALANCED DECOMPOSITION

     M	 : ORDER OF ALLOCATED HYPERCUBE
     N	 : SIZE OF SUBARRAY OF A IN EACH PROCESSOR
     I,J : PROCESSOR POSITION IN GRID MAPPING
     COL : ARRAY OF PROCNUMS IN COLUMN J WITH ROW GREATER THAN I
     ROW : ARRAY OF PROCNUMS IN ROW I WITH COLUMN GREATER THEN J

	  DO 1	L = 1,MIN(I,J)

     *the outer loop is done only once in the first row/column, twice
     *in the second row/column, etc.

	       DO 1  C = 1,N

     *C selects the column to be eliminated

		    IF	L = I  THEN

     *if this program is running in a processor in the top-most
     *active row, then it must set the buffer to the row that will
     *be used in elimination and send it down

			      LR = C + 1
			      DO 2  JJ = 1,N
      2				   BUF(JJ) = A(C,JJ)
			      SEND (COL,BUF,N)
			 ELSE
			      LR = 1
			      RECEIVE (DUM,BUF,N)

		    IF	L = J  THEN

     *if this program is running in a processor in the left-most
     *active column, then it must compute the pivots and send them
     *to the right

			      LC = C + 1
			      DO 3  II = 1,N
      3				   PIV(II) = A(II,C) / BUF(C)
			      SEND (ROW,PIV,N)
			 ELSE
			      LC = 1
			      RECEIVE (DUM,PIV,N)

     *this is the ordinary elimination process that is performed in
     *every processor after BUF and PIV have been set up

		    DO 4  II = LR,N
		    DO 4  JJ = LC,N
      4			 A(II,JJ) = A(II,JJ) - PIV(II) * BUF(JJ)

      1	  CONTINUE





				  - 395 -






     The above code computes a decomposition that looks like this:


	   -------------------------------------------------
	   |	BUF    |    BUF	   |	BUF    |    BUF	   |
	   | X X X X X | X X X X X | X X X X X | X X X X X |
	   |   X X X X | X X X X X | X X X X X | X X X X X |
	   |	 X X X | X X X X X | X X X X X | X X X X X |
	   |	   X X | X X X X X | X X X X X | X X X X X |
	   |	     X | X X X X X | X X X X X | X X X X X |
	   -------------------------------------------------
	   |	BUF    |    BUF	   |	BUF    |    BUF	   |
	   |	       | X X X X X | X X X X X | X X X X X |
	   |	       |   X X X X | X X X X X | X X X X X |
	   |	       |     X X X | X X X X X | X X X X X |
	   |	       |       X X | X X X X X | X X X X X |
	   |	       |	 X | X X X X X | X X X X X |
	   -------------------------------------------------
	   |	BUF    |    BUF	   |	BUF    |    BUF	   |
	   |	       |	   | X X X X X | X X X X X |
	   |	       |	   |   X X X X | X X X X X |
	   |	       |	   |	 X X X | X X X X X |
	   |	       |	   |	   X X | X X X X X |
	   |	       |	   |	     X | X X X X X |
	   -------------------------------------------------
	   |	BUF    |    BUF	   |	BUF    |    BUF	   |
	   |	       |	   |	       | X X X X X |
	   |	       |	   |	       |   X X X X |
	   |	       |	   |	       |     X X X |
	   |	       |	   |	       |       X X |
	   |	       |	   |	       |	 X |
	   -------------------------------------------------
     The  following code is a much more balanced algorithm  since  all
     processors  are  working  until  the last  step.   The  order  of
     elimination  is  the  main difference.   The  first  step  is  to
     eliminate  the  first column in the first column  of  processors.
     However,  the second step is to eliminate the first column of the
     second column of processors and so on.  That is what the "mod" is
     for in the code below.


















				  - 396 -





	    LINEAR EQUATIONS --- BALANCED DECOMPOSITION


     M	  : ORDER OF ALLOCATED HYPERCUBE (K = SQRT(M))
     N	  : SIZE OF SUBARRAY OF A IN EACH PROCESSOR
     I,J  : PROCESSOR POSITION
     ALLC : ARRAY OF PROCNUMS IN COLUMN J (NOT INCLUDING I,J)
     ALLR : ARRAY OF PROCNUMS IN ROW I (NOT INCLUDING I,J)

	  RCNT = CCNT = ROW = COL = 0

	  DO 1	R = 1,N*K-1

	       CNT = R MOD K
	       IF (CNT = I) THEN

			 ROW = ROW + 1
			 DO 2  JJ = COL+1,N
      2			      BUF(JJ) = A(ROW,JJ)
			 SEND (ALLC,BUF,N)

		    ELSE

			 RECEIVE (DUM,BUF,N)

	       IF (CNT = J) THEN

			 COL = COL + 1
			 DO 3  II = COL,N
      3			      PIV(II) = A(II,COL) / BUF(COL)
			 SEND (ALLR,PIV,N)

		    ELSE

			 RECEIVE (DUM,PIV,N)

	       DO 4  II = ROW + 1,N
	       DO 4  JJ = COL + 1,N
      4		    A(II,JJ) = A(II,JJ) - PIV(II) * BUF(JJ)


      1	  CONTINUE
















				  - 397 -






     This code computes a decomposition that looks like:


	   -------------------------------------------------
	   |	BUF    |    BUF	   |	BUF    |    BUF	   |
	   | X X X X X | X X X X X | X X X X X | X X X X X |
	   |   X X X X |   X X X X |   X X X X |   X X X X |
	   |	 X X X |     X X X |	 X X X |     X X X |
	   |	   X X |       X X |	   X X |       X X |
	   |	     X |	 X |	     X |	 X |
	   -------------------------------------------------
	   |	BUF    |    BUF	   |	BUF    |    BUF	   |
	   |   X X X X | X X X X X | X X X X X | X X X X X |
	   |	 X X X |   X X X X |   X X X X |   X X X X |
	   |	   X X |     X X X |	 X X X |     X X X |
	   |	     X |       X X |	   X X |       X X |
	   |	       |	 X |	     X |	 X |
	   -------------------------------------------------
	   |	BUF    |    BUF	   |	BUF    |    BUF	   |
	   |   X X X X |   X X X X | X X X X X | X X X X X |
	   |	 X X X |     X X X |   X X X X |   X X X X |
	   |	   X X |       X X |	 X X X |     X X X |
	   |	     X |	 X |	   X X |       X X |
	   |	       |	   |	     X |	 X |
	   -------------------------------------------------
	   |	BUF    |    BUF	   |	BUF    |    BUF	   |
	   |   X X X X |   X X X X |   X X X X | X X X X X |
	   |	 X X X |     X X X |	 X X X |   X X X X |
	   |	   X X	       X X |	   X X |     X X X |
	   |	     X |	 X |	     X |       X X |
	   |	       |	   |	       |	 X |
	   -------------------------------------------------
     7.3.3.4  Cholesky Method

     When  the matrix is symmetric and positive definite the  Cholesky
     decomposition can be used.  It is stable and faster than Gaussian
     Elimination  and  does  not require pivoting.   The matrix  A  is
     factored into

		    A = LLt

     where Lt = Transpose L and L is lower triangular.

     The   following  program  calculates  L  and  leaves  it  in  the
     processors Pij (that initially contain Aij) where i >=  j.    The
     identical program is loaded into each processor.


     7.3.4  Systems of Ordinary Differential Equations








				  - 398 -





     7.3.5  Partial Differential Equations

     There  are  three  main  types of  second  order  linear  partial
     differential equations:   elliptic, parabolic and hyperbolic.  In
     this  section  we  will  illustrate how  to  solve  the  simplest
     elliptic  equation,   Laplace's  equation  in  a  square  region.
     Laplace's equation is written

	       Uxx + Uyy = 0  in the interior of the region
	       U = f(x,y)     on the boundary

     The  equation can be approximated using second order  differences
     on a two dimensional grid by

	       Uxx = {U(x-h,y) - 2*U(x,y) + U(x+h,y)}/h**2

	       Uyy = {U(x,y-h) - 2*U(x,y) + U(x,y+h)}/h**2

     where h is the grid spacing.   Thus, at each interior grid point,
     p, we have

	       -4*Up + Un +Us + Ue + Uw = 0

     where n,s,e,w stand for the north, south, east and west neighbors
     of p, respectively.

     This is a sparse set of simultaneous linear equations and we will
     use an iterative method known as Successive Over-relaxation (SOR)
     to  solve them.   (The fast direct methods are better, especially
     considering  the  speed of fast fourier transforms (see  7.2.7.3)
     but SOR is simpler and illustrates some important points.)   This
     method  is  similar to the Gauss-Seidel iteration except that  an
     acceleration parameter is used.

























				  - 399 -





     In  order  to  solve  the problem on  an  NCUBE  system  we  must
     partition it onto the hypercube.  To simplify the program we will
     assume  that there are M by M processors and N by N total  points
     where  the solution is desired.   Also we will assume that N >> M
     and that K = N/M is an even integer.  Thus, there are K**2 points
     in each processor as illustrated below.

	  X O X O ...... X O X O -----
	  O		       X     |
	  X		       O     |
	  O	 INTERIOR      X     |
	  .		       .     |
	  .		       .     |---  K
	  .	  POINTS       .     |
	  X		       O     |
	  O		       X     |
	  X		       O     |
	  O X O X ...... O X O X -----

     The  points are labeled with X and O alternating because  we  are
     going  to use a special version of SOR.   The order of evaluation
     of new iterates in SOR can follow a number of strategies.  We are
     going  to  use  the one called  red-black  (X-O)  ordering  which
     alternates  the  points as shown above.   The advantage  of  this
     ordering  is  that when X points are updated,  only O values  are
     used.  Thus, we can overlap communication and computation.  Since
     each  processor  has  to  communicate  its  edge  values  to  its
     neighbors we can update interior values while we are sending edge
     values to the neighbors.





























				  - 400 -





     Because  of the necessity for this communication we must  set  up
     each  node with an extra border of memory locations (a buffer) to
     receive the transmitted values from its neighbors.   Also,  since
     some of the processors are on the actual boundary,  they must not
     receive values on those boundaries but rather keep them constant.
     Below is a four processor illustration of the problem.

	  |-------------------------------------------------|
	  |	   CONSTANT	   |	   CONSTANT	    |
	  |  |------------------|--|--|------------------|  |
	  |  |	     EDGE	|  |  |	     EDGE	 |  |
	  |  |	|------------|	|  |  |	 |------------|	 |  |
	  |  |	|	     |	|  |  |	 |	      |	 |  |
	  |  |	|  INTERIOR  |	|  |  |	 |  INTERIOR  |	 |  |
	  |  |	|	     |	|  |  |	 |	      |	 |  |
	  |  |	|------------|	|  |  |	 |------------|	 |  |
	  |  |	     EDGE	|  |  |	      EDGE	 |  |
	  |  |------------------|  |  |------------------|  |
	  |  |	    BUFFER	   |	     BUFFER	 |  |
	  |--|---------------------|---------------------|--|
	  |  |	    BUFFER	   |	     BUFFER	 |  |
	  |  |------------------|  |  |------------------|  |
	  |  |	     EDGE	|  |  |	      EDGE	 |  |
	  |  |	|------------|	|  |  |	 |------------|	 |  |
	  |  |	|	     |	|  |  |	 |	      |	 |  |
	  |  |	|  INTERIOR  |	|  |  |	 |  INTERIOR  |	 |  |
	  |  |	|	     |	|  |  |	 |	      |	 |  |
	  |  |	|------------|	|  |  |	 |------------|	 |  |
	  |  |	     EDGE	|  |  |	      EDGE	 |  |
	  |  |------------------|--|--|------------------|  |
	  |	   CONSTANT	   |	     CONSTANT	    |
	  |------------------------|------------------------|

     In the above diagram the communication scheme is to send an  edge
     in  one processor to the corresponding buffer in the  neighboring
     processor.

     A  high  level  description  of a program  to  implement  an  SOR
     algorithm is given below.



















				  - 401 -





     Given:
	  M = order of hypercube
	  N = total number of points
     Calculate:
	  K = number of points in each processor = N / M
	  L = K / 2
	  NN = north neighbor number (-1 if edge)
	  EN = east neighbor number (-1 if edge)
	  SN = south neighbor number (-1 if edge)
	  WN = west neighbor number (-1 if edge)
     Allocate and Initialize to Zero:
	  XNE(L) = X's on North Edge
	  ONE(L) = O's on North Edge
	  XNB(L) = X's on North Buffer
	  ONB(L) = O's on North Buffer
	  XEE(L) = X's on East Edge
	  OEE(L) = O's on East Edge
	  XEB(L) = X's on East Buffer
	  OEB(L) = O's on East Buffer
	  XSE(L) = X's on South Edge
	  OSE(L) = O's on South Edge
	  XSB(L) = X's on South Buffer
	  OSB(L) = O's on South Buffer
	  XWE(L) = X's on West Edge
	  OWE(L) = O's on West Edge
	  XWB(L) = X's on West Buffer
	  OWB(L) = O's on West Buffer
	  XI(K-2,K-2) = X Interior points
	  OI(K-2,K-2) = O Interior points
     If	 Neighbor Number = -1 then obtain constant boundary value from
     file.
     The  routines  SEND  and  RECEIVE	simply	return	if  the	 first
     parameter	(Neighbor Number) is less than zero and RECEIVE	 waits
     until the referenced message has been received before returning.
























				  - 402 -





	  CONV = FALSE
     REPEAT UNTIL CONV

	  UPDATE EDGE (XNE,L)
	  UPDATE EDGE (XEE,L)
	  UPDATE EDGE (XSE,L)
	  UPDATE EDGE (XWE,L)

	  SEND (NN,XNE,L)
	  SEND (EN,XEE,L)
	  SEND (SN,XSE,L)
	  SEND (WN,XWE,L)

	  UPDATE INTERIOR (XI,K-2)

	  RECEIVE (NN,XNB,L)
	  RECEIVE (EN,XEB,L)
	  RECEIVE (SN,XSB,L)
	  RECEIVE (WN,XWB,L)

	  UPDATE EDGE (ONE,L)
	  UPDATE EDGE (OEE,L)
	  UPDATE EDGE (OSE,L)
	  UPDATE EDGE (OWE,L)

	  SEND (NN,ONE,L)
	  SEND (EN,OEE,L)
	  SEND (SN,OSE,L)
	  SEND (WN,OWE,L)

	  UPDATE INTERIOR (OI,K-2)

	  RECEIVE (NN,ONB,L)
	  RECEIVE (EN,OEB,L)
	  RECEIVE (SN,OSB,L)
	  RECEIVE (WN,OWB,L)

	  CONVERGENCE (CONV)
     This  description  illustrates  the  key  point  of   overlapping
     communication  with computation (the X edge is being sent on  the
     DMA  channel while the X interior is being updated).

















				  - 403 -





			      Bibliography


     BOOKS


     Caianiello, E. R. (ed.), New Concepts and Technologies in
	  Parallel Information Processing, Noordkoof-Leyden, the
	  Netherlands, 1975.

     Enslow, P. H. (ed.), Multiprocessors and Parallel Processing,
	  Wiley, New York, 1974.

     Feilmeier, M. (ed.), Parallel Computers-Parallel Mathematics,
	  IMACS, North-Holland, New York, 1977.

     Fishburn, J. P., Analysis of Speedup in Distributed Algorithms,
	  UMI Research Press, Ann Arbor, 1981.

     Foster, C. C., Content Addressable Parallel Processors, Van
	  Nordstrom Reinhold, New York, 1976.

     Hockney, R. W. and C. R. Jesshope, Parallel Computers, Adam
	  Higler, Bristol.

     Hord, R. M., The Illiac IV - The First Supercomputer, Computer
	  Science Press, New York, 1983.

     Hwang, K., Computer Architecture and Parallel Processing,
	  McGraw Hill, New York, 1984.

     Kuck, D., et. al., High Speed Computer and Algorithm
	  Organization, Academic Press, New York, 1977.

     Kuhn, R. H. and D. A. Padua (ed.), Tutorial on Parallel
	  Processing, IEEE, New York, 1981.

     Lorin, H., Parallelism in Hardware and Software:  Real and
	  Apparent Concurrency, Prentice-Hall, Englewood Cliffs,
	  New Jersey, 1972.

     Parkinson, D., Supercomputers, Adam Higler, Bristol, 1982.

     Proceedings of the International Conference on Parallel
	  Processing, 1977-1983.

     Proceedings of the International Symposium on Computer
	  Architecture, IEEE and ACM, 1977-1983.

     Proceedings of the Sagamore Computer Conference on Parallel
	  Processing, 1973.







				  - 404 -





     Rodrigue, G. (ed.), Parallel Computations, Academic Press, New
	  York, 1982.

     Ruschitzka, M., Parallel and Large Scale Computers: Performance,
	  Architecture, Applications, North-Holland, New York, 1983.

     Thurber, K. J., Large-scale Computer Architectures:  Parallel
	  and Associative Processors, Hayden, Rochelle Park,
	  New Jersey, 1976.

     Wallach, Y., Alternating Sequential / Parallel Processing,
	  Lecture Notes in Computer Science, Springer-Verlag, New
	  York, 1982.



     ARTICLES--General


     Atallah, M., S. R. Kosaraju, "Graph Problems on a Mesh-Connected
	  Processor Array", ACM Journal, July 1984.

     Haynes, L. S., et. al., "A Survey of Highly Parallel Computing",
	  IEEE Computer, vol 15 no 1, 9-24, Jan 1982.

     Heller, D., "A Survey of Parallel Algorithms in Numerical
	  Linear Algebra", SIAM Review 20, 740-77, 1978.

     Pease, M. C., "The Indirect Binary N-cube Microprocessor Array",
	  IEEE Trans. Computers C-26, 458-73, 1977.

     Poole, W. G., and R. G. Voigt, "Numerical Algorithms for
	  Parallel and Vector Computers:  An Annotated
	  Bibliography", Computing Reviews 15, 379-88, 1974.

     Rice, J., "Parallel Algorithms for Adaptive Quadrature", ACM
	  TOMS, March 1976.

     Stone, H., "Parallel Tridiagonal Equation Solvers", ACM TOMS,
	  289-307, Dec 1975.

     Wang, H. H., "A Parallel Method for Tridiagonal Equations", ACM
	  TOMS, 170-183, June, 1981.















				  - 405 -






     ARTICLES--California Institute of Technology
     Several  groups  at  the California Institute of  Technology  are
     participating  in a project to build and use parallel  processors
     arranged  in  a  hypercube  array.   They  have  written  several
     articles  on  their  work.   Since  the  NCUBE  system  has  many
     similarities  to  the  Caltech systems,  their  articles  contain
     results  that  are  much more directly applicable  to  the  NCUBE
     system than those in the general literature.   In particular, the
     article by G.  Fox and S.  Otto in the May, 1984 issue of Physics
     Today  is an excellent introduction to algorithms that are  ideal
     for  the  NCUBE system.   (In the literature  listed  below  NNCP
     stands for Nearest Neighbor Concurrent Processor.)

     Brooks, E., "Laplace's Equation on the NNCP", CALT-68-959, 1982.

     Brooks, E., G. Fox, "A Simple Mailbox Communication Package for
	  the NNCP", CALT-68-920, 1982.

     Brooks, E., G. Fox, R. Gupta, O. Martin, S. Otto, E.
	  DeBenedictis, "Nearest Neighbor Concurrent Processor",
	  CALT-68-867, 1981.

     Brooks, E., G. Fox, S. Otto, M. Randeria, W. Athas, E.
	  DeBenedictis, M. Newton, C. Seitz, "Glueball Mass
	  Calculations on an Array of Computers", CALT-68-985, 1983.

     Brooks, E., T. Shimomura, "The UNIX Environment for the NNCP",
	  CALT-68-960, 1982.

     Fox, G., "Decomposition of Scientific Problems for Concurrent
	  Processors", CALT-68-986, 1983.

     Fox, G., "Matrix Operations on the Homogeneous Machine",
	  CALT-68-939, 1982.

     Fox, G., S. Otto, "Algorithms for Concurrent Processors",
	  Physics Today, 50-59, May 1984.

     Lang, C. R., "An Extension of Object-Oriented Languages to a
	  Homogeneous Concurrent Architecture", Caltech Ph.D. Thesis,
	  1982.

     Seitz, C., "Ensemble Architecture for VLSI - A Survey and
	  Taxonomy", Proceedings of the Conference on Advanced
	  Research in VLSI, Artech House, 130-35, 1982.












				  - 406 -